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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jedi.api.names with all_scopes=False extracts a class-scoped variable #1202

Closed
immerrr opened this issue Aug 14, 2018 · 3 comments
Closed

jedi.api.names with all_scopes=False extracts a class-scoped variable #1202

immerrr opened this issue Aug 14, 2018 · 3 comments
Labels

Comments

@immerrr
Copy link
Contributor

immerrr commented Aug 14, 2018

Here's a repro example:

In [8]: jedi.api.names(textwrap.dedent("""
   ...:     from module import f
   ...:     g = f(f)
   ...:     class C:
   ...:         h = g
   ...: """), 'example.py', all_scopes=False)
Out[8]: 
[<Definition module f>,
 <Definition g = f(f)>,
 <Definition class C>,
 <Definition h = g>]

In [9]: _8[-1].parent()
Out[9]: <Definition class C>

IIUC <Definition h = g> should not be considered a global definition and thus not returned if all_scopes=False is used.

@davidhalter
Copy link
Owner

I agree. If you PR this as a breaking test somewhere I will probably have it easier to fix it.

Thanks for the report!

@immerrr
Copy link
Contributor Author

immerrr commented Aug 16, 2018

@davidhalter there you go: #1203

@davidhalter
Copy link
Owner

Fixed by yourself, thanks again!

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

No branches or pull requests

2 participants