If the implementation lands in typing_extensions *now*, maybe it's reasonable to review that and copy it into the stdlib as soon as the PEP has been accepted. We could make that work. Don't wait implementing until the PEP is accepted though!
> On 22 May 2019, at 11:35, Bernat Gabor <firstname.lastname@example.org> wrote:
> 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?
Not necessarily. Mentioned in the PEP is a possible struct module runtime
integration. I co-maintain Injector, a dependency injection framework, and
It could also use the extra metadata at runtime. Currently one declares a
constructor mixing injectable and non-injectable parameters like this:
def __init__(self, service: Service, value: Value):
This PEP would make the following possible while reducing repetition
somewhat and improving editor integration:
def __init__(self, service: Service, value: Assisted[Value]):
Or even (remains to be seen which is better, maybe both could coexist):
def __init__(self, service: Inject[Service], value: Value):
(Assisted and Inject are hypothetical generic aliases).
Typing-sig mailing list -- email@example.com
To unsubscribe send an email to firstname.lastname@example.org