Skip to content

New semantic analyzer: Fix (de)serialization of broken named tuples #6421

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 6 commits into from
Feb 18, 2019

Conversation

ilevkivskyi
Copy link
Member

@ilevkivskyi ilevkivskyi commented Feb 17, 2019

Fixes #6413

In my original PR I missed the fact that "broken" named tuples (those where variable name and named tuple name are different) are stored under both names (one to actually access it, and other for (de)serialization).

I also extend the semantic analyzer API, and clean-up/clarify the symbol adding logic a bit.

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Left some requests for clarification, since this is some pretty tricky code.

@@ -1794,8 +1794,13 @@ def patch_dependency_parents(self) -> None:
semantic analyzer will perform this patch for us when processing stale
SCCs.
"""
Analyzer = Union[SemanticAnalyzerPass2, NewSemanticAnalyzer] # noqa
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's this change? Is is related to the rest of this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is needed because otherwise incremental tests crash with the new analyzer (I added couple incremental tests) with something like 'BuildManager' doesn't have attribute 'semantic_analyzer'.

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks for the updates!

@ilevkivskyi ilevkivskyi merged commit 027b86d into python:master Feb 18, 2019
@ilevkivskyi ilevkivskyi deleted the new-fix-broken-nt branch February 18, 2019 13:57
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