--
Jack Jansen, <Jack.Jansen@cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma Goldman
On 8 Jan 2022, at 11:32, Serhiy Storchaka <storchaka@gmail.com> wrote:08.01.22 01:59, jack.jansen@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]]]]
def get_foo_factory(type: str, id: int) -> Factory[Foo]: ...
instead of
def get_foo_factory(type: str, id: int) -> Callable[[int,
Iterable[str]], Optional[list[Mapping[str, Sequence[Tuple[int,
Foo]]]]]]: ...
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-leave@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/42A5UC246FL2C57WSXP5Y2DANFGTG4PU/
Code of Conduct: http://python.org/psf/codeofconduct/