So does your library work both with and without ‘from __future__ import annotations’? If it does, you shouldn’t have to worry. If it doesn’t, it would be useful if you could post some detailed examples of what goes wrong.
On Fri, Nov 26, 2021 at 14:24 Christopher Barker <python...@gmail.com> wrote: > > > On Fri, Nov 26, 2021 at 1:47 PM Guido van Rossum <gu...@python.org> wrote > > It's easy enough to do something at runtime with `def f(a: list[int]) > -> int`. It's not so simple to handle `def f(a: Sequence[T]) -> T` or `def > f(cb: (T) -> tuple[str, T], Sequence[T]) -> Mapping[str, T]`. Presumably > frameworks like pydantic just don't support such things and tell the user > not to do that. > > I don’t know about Pydantic, but that’s exactly my use case: the type > needs to be an actual intstantiatable type. > > So list and tuple is fine, and Sequence[t] won’t work. But it’s fine > that this use case is restricted. > > In fact, other than the basic core types, you need to use specialized > types with this system anyway. > > -CHB > -- > Christopher Barker, PhD (Chris) > > Python Language Consulting > - Teaching > - Scientific Software Development > - Desktop GUI and Web Development > - wxPython, numpy, scipy, Cython > -- --Guido (mobile)
_______________________________________________ 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/KQDOEO7CIDIFG6N26EYRYUSRW4UYPRZ7/ Code of Conduct: http://python.org/psf/codeofconduct/