[Python-Dev] PEP 563: Postponed Evaluation of Annotations

Lukasz Langa lukasz at langa.pl
Thu Nov 2 17:25:25 EDT 2017


> On Nov 2, 2017, at 1:13 PM, Stéfane Fermigier <sf at fermigier.com> wrote:
> 
> Another common use case is dependency injection / IoC:
> 
> - Injector (https://github.com/alecthomas/injector <https://github.com/alecthomas/injector>):
> - Flask-Injector (ok it's the same underlying injector):

Pretty cool! This is already using `get_type_hints()` so it's perfectly compatible with PEP 563:

https://github.com/alecthomas/injector/blob/master/injector.py#L915

> - Apistar components (https://github.com/encode/apistar#components <https://github.com/encode/apistar#components> ):

This is using `inspect` directly so will have to migrate to `get_type_hints()` later. But, as the PEP mentions, it should already be using `get_type_hints()` since people are free to use forward references even today.

Thanks for flagging those use cases!


- Ł
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20171102/d9b9d4ef/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 874 bytes
Desc: Message signed with OpenPGP
URL: <http://mail.python.org/pipermail/python-dev/attachments/20171102/d9b9d4ef/attachment.sig>


More information about the Python-Dev mailing list