Created
March 10, 2016 22:02
-
-
Save saml/09a47bd1d2d130309371 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class One: | |
def __next__(self) -> int: | |
return 1 | |
class OneStr: | |
def __init__(self) -> None: | |
self.iterable = One() | |
def __next__(self) -> str: | |
return str(next(self.iterable)) | |
# mypy foo.py | |
# foo.py: note: In member "__next__" of class "OneStr": | |
# foo.py:10: error: No overload variant of "next" matches argument types [foo.One] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment