4 ms·
Type annotations are used at runtime in some cases, most notably when defining dataclasses.
by goodside 5y ago
Type annotations are used at runtime in some cases, most notably when defining dataclasses.
- musingsole 5y agoI find this a bit of a wart on the dataclass implementation. Type hints (to me) are more like a comment than a statement. So, from my perspective, dataclasses feel like they're pulling data out of nearby comments. Ick. But it's a wart worth the conciseness, at least, until a better idea comes along. Maybe if type hints could be optionally enforced as a language feature, I'd feel it was more integrated.