Skip to content

Revert "selftype in namedtuple methods" #2414

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 1 commit into from
Nov 7, 2016

Conversation

gvanrossum
Copy link
Member

Reverts #2408

This appears to have a bug; see my comment to the PR for an explanation.

@gvanrossum gvanrossum merged commit 4f7dbfc into master Nov 7, 2016
@gvanrossum gvanrossum deleted the revert-2408-namedtuple_selftype branch November 7, 2016 21:59
@elazarg elazarg mentioned this pull request Nov 11, 2016
gvanrossum pushed a commit that referenced this pull request Nov 13, 2016
(Reopening #2408 after the revert #2414. This fixes parts of #2090)
This PR does three things:

    Fix the handling of TupleType (pass original_type recursively)
    Fix the handling of TypeType (avoid ad-hoc buggy special casing)
    Make NamedTuple's _replace() and _make() return selftype, serving as test case for (1) and (2)

As a consequence of (1), some error messages are changed, as exemplified in check-isinstance.test. I think it's better now, but if it isn't, perhaps we should separate original_type and report_type as discussed in #2193.
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.

1 participant