KEMBAR78
Add missing dependency from missing module attribute by JukkaL · Pull Request #5861 · python/mypy · GitHub
Skip to content

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Oct 31, 2018

Fixes #4782.

@JukkaL JukkaL requested a review from ilevkivskyi October 31, 2018 11:22
Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nice simple solution. I have two suggestions.

[out]
<a.C.x> -> m
<a.C> -> m

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a fine grained test too, so that it will not regress for other (non dependency caused) reasons.

# it wasn't type checked and we don't need to generate dependencies.
return
if isinstance(e.expr, RefExpr) and isinstance(e.expr.node, MypyFile):
# Special case: reference to a missing module attribute.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also update the comment few lines above (can't comment there):

# Reference to a non-module attribute -> # Reference to a non-module (or missing) attribute

@JukkaL JukkaL merged commit 0b61e54 into master Nov 1, 2018
@gvanrossum gvanrossum deleted the fg-ignore-attr branch November 14, 2018 04:08
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 this pull request may close these issues.

2 participants