I suspect python 4.0 will be the version in which python will have core support for typing so for example builtin collections will inherit typing.Generic
arange: list[int]
attribs: dict[str, Any]
we will be able to define typevars in signatures
def filter[T](x: Iterable[T]) -> Iterator[T]:
...
and all types will have | and & operators for typing.Union and the planned typing.Intersection respectively (like in typescript)
Union[str, bytes] == str | bytes
Maybe also add Any and a few generic abstracts to builtins.
11
u/XtremeGoose f'I only use Py {sys.version[:3]}' Jun 28 '18 edited Jun 28 '18
I suspect python 4.0 will be the version in which python will have core support for typing so for example builtin collections will inherit
typing.Genericwe will be able to define typevars in signatures
and all types will have
|and&operators fortyping.Unionand the plannedtyping.Intersectionrespectively (like in typescript)Maybe also add
Anyand a few generic abstracts to builtins.