Discussions involving typing in Python.
Previously this was the
typing-sig mailing list.
Not sure what is the expected scope of this category. Does this category welcome any kind of contribution or is it rather expected to be for “experts” first? For example does the following linked topic belong in this category?
PEP 695 accepted in Python 3.12, the soft keyword type can be used to create type aliases.
from typing import TypeAlias
Point: TypeAlias = tuple[float, float]
type Point = tuple[float, float]
However, the current way to create NewTypes involves importing from the typing module, and providing a name string, which is unintuitive:
from typing import NewType
OrderId = NewType("OrderId", int)
Unlike type aliases, NewTypes don’t have first-class syntax support.
And also should also all discussion tagged with
be moved to this category? typing
I think this category is generally concerned with
ideas for extensions to Python’s typing system and syntax. That is, the Typing category is a subset of the more-general Ideas category.
This is consistent with the purpose of the original
typing-sig mailing list, which this category was created from.
Out of scope:
Questions about how certain code works that happens to use a lot of typing syntax should generally go to
I’d argue that topic
would be better-filed under this Typing category.