kuroko/test/testClassAnnotation.krk
2021-03-13 14:22:32 +09:00

11 lines
218 B
Python

class Foo(object):
a:int = 42
b:float = 96.8
s:str = "test"
def method(self, foo: type(a)) -> type(a):
return self.a + foo
d:bool = False
print(Foo.__annotations__)
print(Foo().method(42))