10000 Remove tuple's __init__ method by msullivan · Pull Request #2467 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content
10000

Remove tuple's __init__ method #2467

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
Sep 19, 2018
Merged

Remove tuple's __init__ method #2467

merged 2 commits into from
Sep 19, 2018

Conversation

msullivan
Copy link
Contributor
@msullivan msullivan commented Sep 19, 2018

The __new__ method should suffice, and having both interferes with providing
a __new__ in namedtuples, which we want to do to fix
python/mypy#1279.

The __new__ method should suffice, and having both interferes with providing
a __new__ in namedtuples, which we want to do to fix
python/mypy#1279.
@msullivan
Copy link
Contributor Author

Though actually the problem only comes up because of python/mypy#1435, so it is probably worth fixing that.

tuple doesn't have a __init__ method, though, so kind of no reason to not land this if it doesn't break anything.

@gvanrossum
Copy link
Member

(Also I think in general mypy should in general allow redundant __new__ and __init__ methods, as long as the signatures match or at least overlap. After all if we have annotations in the code there may be legitimate cases that define both. However, tuple doesn't actually have __init__, only __new__, so this PR is still the right thing.)

yedpodtrzitko pushed a commit to yedpodtrzitko/typeshed that referenced this pull request Jan 23, 2019
The __new__ method should suffice, and having both interferes with providing
a __new__ in namedtuples, which we want to do to fix
python/mypy#1279.
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.

3 participants
0