Scenario: forward references
Given that "fwref.py" contains the following code:
"""
class Myself:
def equals(self, other: id) -> bool:
return other == self
a = Myself()
b = Myself()
a.equals(b)
a.equals(42)
"""
When "python3 fwref.py" is run
Then it must fail:
"""
typesafety.validator.TypesafetyError: Argument 'other' of function 'equals' is invalid (expected: Myself; got: int)
"""
How about this?
(Note that there's a different idea for this in PEP0484: https://www.python.org/dev/peps/pep-0484/#forward-references )