3 ms·
Good article! I found the typing bits particularly interesting. This part of the language has been evolving rapidly recently, which is cool if you like static t
by ratmeadow 1y ago
Good article! I found the typing bits particularly interesting. This part of the language has been evolving rapidly recently, which is cool if you like static typing.
Although I think the example of type alises in section 4 is not quite right. NewType creates a new "subtype" which is not equivalent to the original type. That's different to TypeAlias, which simply assigns a name to an existing type. Hence NewType is still useful in Python 3.12+.
- mdaniel 1y ago> which is cool if you like static typing. I don't believe any reasonable person would call Python statically typed, it just now has a pathway though which one can send additional documentation, with all of its caveats python3.13 -c ' foo: dict[str, list] = "lol" print(foo.keys()) ' And, yes, I am aware of the chorus of "just sprinkler more linters"