3 ms·
Ah, we disagree on that reading of PEP 387 then. I read it to say the API or behavior being altered must have a deprecation warning for two major releases.
by jhayward 6y ago
Ah, we disagree on that reading of PEP 387 then. I read it to say the API or behavior being altered must have a deprecation warning for two major releases.
- williamsmj 6y agoNo. I agree with your reading, but the reality is that the PSF doesn't appear to interpret it that way and it's sufficiently vague to allow them to get away with that :( I can't remember the last time (if ever) I saw a runtime deprecation warning from cpython itself (I see plenty from libraries). I don't understand PEP 563 (or the python type system and ecosystem of tooling) well enough to know whether it would even be possible for cpython itself to issue a deprecation warning in this case. In any case, it's clear that the pydantic and fastapi authors were aware of this issue.
- williamsmj 6y agoLike I say, it's clear the pydantic and fastapi authors were aware of this issue, but for what it's worth I confirmed that no runtime warnings were issued for PEP 563. The behavior has been available via `from __future__ import annotations` since Python 3.7. It was the very first change mentioned in the 3.7 release notes (alongside an explicit statement that it would become default four years later in 3.10): https://github.com/python/cpython/blob/a41782cc84bcd813209a03e6e11c60e77dbc7718/Doc/whatsnew/3.7.rst#pep-563-postponed-evaluation-of-annotations https://github.com/python/cpython/blob/a41782cc84bcd813209a0...