We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently the tuple constructor only accepts iterables.
tuple
typeshed/stdlib/builtins.pyi
Lines 932 to 933 in 97ccd89
__getitem__
class A: def __getitem__(self, key): if key >= 3: raise IndexError return key print(tuple(A())) # (0, 1, 2)
A _GetItemIterable could be added to tuple.__new__ signature like for iter.
_GetItemIterable
tuple.__new__
iter
Lines 1424 to 1431 in 97ccd89
I am open to make a PR to fix it.
The text was updated successfully, but these errors were encountered:
Sort of a duplicate of #7813, which we closed as "wontfix" (see detailed discussion in that issue for why :-)
Sorry, something went wrong.
Thank you, I need to improve my issue searching methodology.
No branches or pull requests
Currently the
tuple
constructor only accepts iterables.typeshed/stdlib/builtins.pyi
Lines 932 to 933 in 97ccd89
But the
tuple
constructor can also take in classes that only have the__getitem__
method and is not iterable.A
_GetItemIterable
could be added totuple.__new__
signature like foriter
.typeshed/stdlib/builtins.pyi
Lines 1424 to 1431 in 97ccd89
I am open to make a PR to fix it.
The text was updated successfully, but these errors were encountered: