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

Reminds me for https://xkcd.com/1172/

Type annotations were meant to be used as linting, and other forms of type-checking done NOT AT RUNTIME. Gradually, some support for using them at runtime popped up, and them annotations starting being [ab]used for all sorts of things.

PEP 563 (the one breaking pydantic here) is actually super important: it allows referencing things defined later. Like, a function on line 1 can take a type on line 10 as parameter. It is super necessary to make type annotations usable for their original purpose.

It breaks pydantic, but also makes annotations usable for their intended purpose. Previously you had to manually opt it on each file, and now it's the default, as planned.

I feel like pydantic and tools built on top of it were built ignoring the direction on which Python was heading. Much like the user in xkcd#1172.



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

Search: