Why is __future__.annotations (PEP 563) not backported to python3.6?

648 Views Asked by At

Does anyone know why PEP 563 is not backported to python36 as of the time of this writing? Are there any plans to do that or is it even possible?

I am asking because I could use it for the codebase of zfit which currently supports py36 through py38 and I cannot use forward references without using strings which is a tad annoying. Especially considering that it is available in py37 and upwards.

1

There are 1 best solutions below

0
On BEST ANSWER

__future__ features are made available in a specific, documented release of Python and not backported. In many cases, making them available at all introduces major changes to the Python parser that are not trivial to backport. annotations is documented to have been added in 3.7.0b1, and as such will never exist in earlier versions of Python. If you want to use the feature, you will need to limit support to 3.7+, or make a separately maintained release for 3.6.x.