Replies
|
I think what you're looking for is a |
1 reply
Answer selected by zzzeek
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Insert Link
Translated from {{ originalLanguageInEnglish }}
Beta Was this translation helpful? Give Feedback
Beta 이 번역이 도움이 되셨나요? 피드백 제공
Beta Esta tradução foi útil? Dê sua opinião
Beta ¿Fue útil esta traducción? Envía tus comentarios
Starting with a really basic generic class:
we can make a new class that is given an
Elementas a constructor argument, and is then itself a class that is alsoGeneric[_T]:my hope for pep-646, which I'm not sure now is covered at all, is the exact same pattern as above, except for a
ContainerOfMultipleElements. This seems like the most simple, basic thing that would be allowed from a typing extension that grants the ability to make custom tuple-like classes, and for all the ORM use cases that I've seen discussed in some older pep-646 discussions, this would be the bare minimum thing needed. I'm currently working with the pep-646 support in pyright to test, but with no luck. Is the below possible? that is, aMyTuple[_T, ...]that's constructed from aTuple[Element[_T], ...]?: