inspect_stock_annotations.py 509 B

12345678910111213141516171819202122232425262728
  1. a:int=3
  2. b:str="foo"
  3. class MyClass:
  4. a:int=4
  5. b:str="bar"
  6. def __init__(self, a, b):
  7. self.a = a
  8. self.b = b
  9. def __eq__(self, other):
  10. return isinstance(other, MyClass) and self.a == other.a and self.b == other.b
  11. def function(a:int, b:str) -> MyClass:
  12. return MyClass(a, b)
  13. def function2(a:int, b:"str", c:MyClass) -> MyClass:
  14. pass
  15. def function3(a:"int", b:"str", c:"MyClass"):
  16. pass
  17. class UnannotatedClass:
  18. pass
  19. def unannotated_function(a, b, c): pass