26 Apr
2022
26 Apr
'22
3:29 a.m.
The forward class annotations would not need need to be processed at runtime and could be no-ops. forward class A: x: int y: list[int] A.__annotations__ could be empty. For a more complete example you could have, forward class A: value: B # This annotation is solely for type checker and is not actually saved at runtime. class B: value: A # Real annotation that is saved. continue class A: value: B # Real annotation that is saved. The rule would then be that any annotation inside forward class is equivalent to a noop. Continue class would still need to have same annotation repeated to actually set it at runtime.