1

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.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
SebastianJL
  • 169
  • 1
  • 1
  • 8
  • 1
    Would knowing why help if there is still no plan to change it? – Mark Ransom Jul 07 '20 at 18:36
  • It would not help the code of my project look cleaner but it would be very interesting to know. So if you have a partial answer please go ahead and post it. – SebastianJL Jul 07 '20 at 18:44
  • No, I don't have an answer. But if I had to guess, it's because allowing a `from __future__` allows developers to test new features in the *current* version before it's ready to go live in a *new* version. If so there's no benefit *to the developers* to back-porting. – Mark Ransom Jul 07 '20 at 18:49

1 Answers1

2

__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.

ShadowRanger
  • 143,180
  • 12
  • 188
  • 271