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

Skip to content

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.

8000
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