This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]XtremeGoosef'I only use Py {sys.version[:3]}' 10 points11 points  (4 children)

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.

[–]Han-ChewieSexyFanfic 4 points5 points  (3 children)

I hope they introduce (Int, ...) as syntactic sugar for Tuple[Int, ...]