2 ms·
Annotations were specifically designed as general-purpose, not specifically type annotations. So the ability to put arbitrary expressions in annotations was ver
by masklinn 8y ago
Annotations were specifically designed as general-purpose, not specifically type annotations. So the ability to put arbitrary expressions in annotations was very much intended.
In fact, the type hints of the typing module are not actually types.
- benatkin 8y agoAh, I see, good to know. What I wanted when I found the PEP a few days ago were docstrings for instance variables, which isn't one of the things that this provides, so I stopped reading. I ended up using properties but it's a bit verbose. It's great that typings are in a module so it can be extended or replaced!