Closed johannesrld closed 1 year ago
(Per pep0695)
Python 3.12 (Upcoming) introduced a new soft keyword called type which allows you to do something like this:
# A non-generic type alias type IntOrStr = int | str # A generic type alias type ListOrSet[T] = list[T] | set[T]
(It also introduces generics syntax for things like functions and classes but thats probably better left to another issue)
Added on master
(Per pep0695)
Python 3.12 (Upcoming) introduced a new soft keyword called type which allows you to do something like this:
(It also introduces generics syntax for things like functions and classes but thats probably better left to another issue)