There's no requirement that type annotations be accurate.
With hidden classes and such it likely wouldn't matter much. You'd need them anyway for full dynamism
With hidden classes and such it likely wouldn't matter much. You'd need them anyway for full dynamism
We haven’t gone the hidden classes route so far because it’s simpler to just look at attributes assigned in __init__ and annotated on the class and lock those into slots. If you’re writing typed Python you probably don’t do a lot of tacking extra ad hoc attributes onto instances, since type checkers don’t like that either.