Skip to content

New semantic analyzer: Various small updates #6246

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

Merged
merged 2 commits into from
Jan 24, 2019
Merged

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jan 24, 2019

These respond to some review feedback to
#6240.

These respond to some review feedback to
#6240.
@JukkaL JukkaL requested a review from ilevkivskyi January 24, 2019 13:56
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.

Thanks! Two optional comments.

@@ -17,6 +17,9 @@

def semantic_analysis_for_scc(graph: 'Graph', scc: List[str]) -> None:
# Assume reachability analysis has already been performed.
#
# Note that functions can't define new module-level attributes,
# since module top levels are fully processed before functions.
Copy link
Member

Choose a reason for hiding this comment

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

Sorry for being annoying, but maybe explicitly mention global x here? (and clarify whether it is a temporary or principal limitation?)

# flags: --new-semantic-analyzer
import b
[file a.py]
from b import bad # E: Module 'b' has no attribute 'bad'
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 prefer an error in both files, but at least one is also OK.

@JukkaL JukkaL merged commit 560888d into master Jan 24, 2019
@JelleZijlstra JelleZijlstra deleted the new-semanal-proto-3-misc branch January 25, 2019 04:38
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