
Le mar. 16 juin 2020 à 10:42, Inada Naoki <songofacandy@gmail.com> a écrit :
Hmm, Is there any chance to add DeprecationWarning in Python 3.9?
In my experience, more and more projects are running their test suite with -Werror, which is a good thing. Introducing a new warning is likely to "break" many of these projects. For example, in Fedora, we run the test suite when we build a package. If a test fails, the package build fails and we have to decide to either ignore the failing tests (not good) or find a solution to repair the tests (update the code base to new C API functions).
It is an interesting idea, but I think it is too complex. Fixing all packages in the PyPI would be a better approach.
It's not the first time that we have to take such decision. "Fixing all PyPI packages" is not possible. Python core developers are limited are so we can only port a very low number of packages. Breaking packages on purpose force developers to upgrade their code base, it should work better than deprecation warnings. But it is likely to make some people unhappy. Having a separated hash table would prevent to break many PyPI packages by continuing to provide the backward compatibility. We can even consider to disable it by default, but provide a temporary option to opt-in for backward compatibility. For example, "python3.10 -X unicode_compat". I proposed sys.set_python_compat_version(version) in the rejected PEP 606, but this PEP was too broad: https://www.python.org/dev/peps/pep-0606/ The question is if it's worth it to pay the maintenance burden on the Python side, or to drop backward compatibility if it's "too expensive". I understood that your first motivation is to reduce PyASCIObject structure size. Using a hash table, the overhead would only be paid by users of the deprecated functions. But it requires to keep the code and so continue to maintain it. Maybe I missed some drawbacks. Victor -- Night gathers, and now my watch begins. It shall not end until my death.