Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Type annotations are used at runtime in some cases, most notably when defining dataclasses.


I 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: