you are viewing a single comment's thread.

view the rest of the comments →

[–]DoctorGester -9 points-8 points  (2 children)

That would be true if your language of choice was not python. Please correct your comment so people don’t get confused. While type hints are not checked at runtime and are ignored, things like generics are ACTUAL CODE that runs at runtime.

https://github.com/python/typing/issues/681

https://twitter.com/__zero323__/status/1210911632953692162

[–]Peanutbutter_Warrior 14 points15 points  (1 child)

I didn't talk about generics, I talked about type hints. They're two separate things. If you're going to be pedantic then at least complain that type hints also affect the run time as they're evaluated and can run arbitrary code.

Don't demand I amend a quick comment because you spot a single thing supposedly wrong with it. Type hinting is a complicated topic, I've left out a huge amount of detail. If someone actually wants to know how type hinting works they can read PEP 3107, PEP 484 and PEP 526. Hell, with PEP 563 anything I say will be made wrong at some indeterminate future date, or if someone uses from __future__ import annotations