> On Sep 12, 2017, at 5:38 AM, Ivan Levkivskyi <levkivs...@gmail.com> wrote: > > In principle, I like this idea, this will save some keystrokes > and will make annotated code more "beautiful". But I am quite worried about > the backwards > compatibility. One possible idea would be to use __future__ import without a > definite > deprecation plan.
This is not a viable strategy since __future__ is not designed to be a feature toggle but rather to be a gradual introduction of an upcoming breaking change. > If people will be fine with using typing.get_type_hints > (btw this is already the preferred way instead of directly accessing > __annotations__, > according to PEP 526 at least) then we could go ahead with deprecation. As you're pointing out, people already have to use `typing.get_type_hints()`, otherwise they are already failing evaluation of existing forward references. Accessing __annotations__ directly in this context is a bug today. > Also I really like Yury's idea of dynamic mapping I responded to his idea under his post. - Ł
signature.asc
Description: Message signed with OpenPGP
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/