top | item 45400082

(no title)

mrln | 5 months ago

With the newest Python versions, most of the time I don't need typing imports!

discuss

order

letmeinhere|5 months ago

Yeah post 3.10 you don't need Union, Optional, List, Duct, Tuple. Any still necessary when you want to be permissive, and I'm still hoping for an Unknown someday...

maleldil|5 months ago

> hoping for an Unknown someday

Wouldn't that just be `object` in Python?

__MatrixMan__|5 months ago

> List, Duct, Tuple...

I'm aware this is just a typo but since a lot of the Python I write is in connection with Airflow I'm now in search of a way to embrace duct typing.

rgovostes|5 months ago

I am glad they improved this but I still like Optional[], and to a lesser extent, Union[]. It's much more readable to have Optional[str] compared to str | None.