Skip to content

Instantly share code, notes, and snippets.

@saml
Created March 10, 2016 22:02
Show Gist options
  • Save saml/09a47bd1d2d130309371 to your computer and use it in GitHub Desktop.
Save saml/09a47bd1d2d130309371 to your computer and use it in GitHub Desktop.
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