Guest User

Untitled

a guest
Jan 24th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. import typing
  2.  
  3. SomeType = typing.NewType('SomeType', str)
  4. OtherType = typing.NewType('OtherType', str)
  5. def fun(s: typing.Type[str]):
  6. pass
  7.  
  8. fun(SomeType('foo'))
  9.  
  10. mypy_test.py:5: error: Argument 1 to "fun" has incompatible type "SomeType"; expected "Type[str]"
Add Comment
Please, Sign In to add comment