I like to where this is going. Plus one from me. I assume the main users of this annotated metadata will be typing checker(s) plugins? Do we provide any unrolling guarantees with type aliases? UnsignedShort = Annotated[int, struct2.ctype('H')] class Student(struct2.Packed): name: UnsignedShort Do we get? get_type_hints(Student, include_extras=True) == { 'name': UnsignedShort} or get_type_hints(Student, include_extras=True) == { 'name': Annotated[int, struct2.ctype('H')]} I would propose to make it explicit what's the expected behaviour here (so processing code does not need to handle both cases). I'd guess the easiest and safest is to go with the { 'name': UnsignedShort} form always. On Wed, May 22, 2019 at 9:06 AM Jakub Stasiak <jakub@stasiak.at> wrote:
On 20 May 2019, at 21:18, Till <till.varoquaux@gmail.com> wrote:
Hi,
We've just landed pep-593 (https://www.python.org/dev/peps/pep-0593/); it proposes adding support to embed metadata inside type annotations. I'm looking forward to hearing people's opinion.
Best, Till _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
As mentioned in https://github.com/python/typing/issues/600 I’m a big fan of this proposal. Is there a chance an experimental implementation emerges before this PEP is accepted? If there was I’d really like to implement Injector integration to see if it does all I expect it to.
Best, Jakub _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/