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
__getitem__
Sample:
class Some: def __getitem__(self, i: int) -> str: if i >= 2: raise IndexError() return chr(97 + i) s = Some() for x in s: # error here print(x)
Output:
» mypy out/ex.py --strict-optional --warn-unreachable --show-traceback out/ex.py:10: error: "Some" has no attribute "__iter__" (not iterable)
But, in runtime it works just fine:
» python out/ex.py a b
Docs: https://pyneng.readthedocs.io/en/latest/book/23_oop_special_methods/iterable_iterator.html#iteration-protocol
I will try to send a PR soon!
The text was updated successfully, but these errors were encountered:
I'm pretty sure there's already a bug for this. Thanks for working on it!
Sorry, something went wrong.
Yes: #2220 Found it!
@sobolevn want to review #10386 ?
@hauntsaninja done!
No branches or pull requests
Sample:
Output:
But, in runtime it works just fine:
Docs: https://pyneng.readthedocs.io/en/latest/book/23_oop_special_methods/iterable_iterator.html#iteration-protocol
I will try to send a PR soon!
The text was updated successfully, but these errors were encountered: