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

Fully analyze named tuple subclasses in third pass #5644

Merged
merged 5 commits into from Sep 19, 2018

Conversation

Projects
None yet
2 participants
@ilevkivskyi
Copy link
Collaborator

commented Sep 19, 2018

Fixes #5195

The fix is straightforward, previously tuple_type was not analyzed for named tuple subclasses.
I also copy the line number for instance types when transforming them.

@ilevkivskyi ilevkivskyi requested a review from msullivan Sep 19, 2018

Ivan Levkivskyi
@msullivan
Copy link
Collaborator

left a comment

Looks good.

Is there a similar transformation that ought to be done for typeddict_type as well?

@ilevkivskyi

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 19, 2018

Is there a similar transformation that ought to be done for typeddict_type as well?

I think no. A subclass of a typed dict is also a typed dict (i.e. it becomes itself a "magic" class), while subclassing a named tuple creates a more "normal" class. But I think it makes sense to add a test just for completeness.

@ilevkivskyi ilevkivskyi merged commit 28b1bfe into python:master Sep 19, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ilevkivskyi ilevkivskyi deleted the ilevkivskyi:rec-tuple-crash branch Sep 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.