-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add support for stub modules semantics #72
Add support for stub modules semantics #72
Conversation
… simplifies the callback.
Better implementation of is_typing_name().
…ineno when we need it now.
else: | ||
return self.orgmodule | ||
|
||
_alias_needs_lineno = platform.python_implementation().lower() == 'cpython' and sys.version_info < (3,10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather do _alias_needs_lineno = 'lineno' in ast.alias._attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum, i don’t think it will work. Since the field exists but is set to None (I believe)
@@ -290,14 +468,61 @@ class DefUseChains(ast.NodeVisitor): | |||
One instance of DefUseChains is only suitable to analyse one AST Module in it's lifecycle. | |||
""" | |||
|
|||
def __init__(self, filename=None): | |||
def __init__(self, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm stopping my review here, I think we discussed you should try to subclass beniget instead of adding a conditional path in it. Did you change your mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the reason is described in the PR text. But let’s chat about it
Can you continue your review of these changes? |
Hello @serge-sans-paille, and happy new year. |
Fixes #55
I implemented some flexibility around the module name resolving and detect whether the module is a stub or a package. So isolating this new feature into a new class doesn’t really make sens. Because we’ll loose some auto detection feature that all users of beniget should enjoy having builtin.
Let me know what you think of this implementation.
I'll add more comments...