Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firstparty + from ... import ... corner case #2167

Open
thejcannon opened this issue Aug 22, 2023 · 1 comment 路 May be fixed by #2168
Open

Firstparty + from ... import ... corner case #2167

thejcannon opened this issue Aug 22, 2023 · 1 comment 路 May be fixed by #2168

Comments

@thejcannon
Copy link

馃憢

I come from pantsbuild land! I'm looking at trying to help world-model in this issue

One attempt was to specify each "known" module that we're going to supply (with -p=...) but ran into an interesting corner case.

Given

import requests

from subdirA import fileA

Running isort -p=subdir.fileA file.py (where subdir.fileA isn't in the sandbox we're running isort in) puts both imports together.
Whereas:

import requests

import subdirA.fileA

doesn't.

@thejcannon
Copy link
Author

I guess it's a flavor of ambiguity whether fileA is assumed to be a non-module object in subdirA, or whether we can also be OK with maybe thinking fileA could also be a module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant