On Sat, Jan 08, 2022 at 12:32:35PM +0200, Serhiy Storchaka wrote:
> 08.01.22 01:59, jack.jan...@cwi.nl пише:
> >> If I can make a wild suggestion: why not create a little language for
> >> type specifications?
> 
> We need a way to define aliases. For example, write:
> 
> Data = Mapping[str, Sequence[Tuple[int, T]]]
> Factory = Callable[[int, Iterable[str]], Optional[list[Data[T]]]]

Can't we already do that?

https://docs.python.org/3/library/typing.html#type-aliases

Type aliases are great. But there are times where we don't want to write 
an alias when we can just write the type in-place, just as there are 
times where we don't want to write a function when we can just use an 
in-place expression.


-- 
Steve
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/ZRYSXMF2HRC5HXIZLQ4FTSL44PF6TXPS/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to