GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [3.8] bpo-37250: put back tp_print for backwards compatibility by jdemeyer · Pull Request #14193 · python/cpython Conversation
|
|
+1, but let's refrain from merging until there's clearer consensus on the tracker issue for the pragmatic Py3.8-only source compatibility fix. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| vectorcallfunc tp_vectorcall; | ||
|
|
||
| /* Unused, kept for backwards compatibility in CPython 3.8 only */ | ||
| int (*tp_print)(PyObject *, FILE *, int); |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Does adding the Py_DEPRECATED(3.8) macro here cause the tp_print reference in the test to generate a compiler warning?
If it does, that would be a good thing to add (as long as we also have a way to disable the deprecation warning in the test suite, which I presume we do)
Reference: https://docs.python.org/3.8/c-api/intro.html#c.Py_DEPRECATED
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That works but then the deprecation warning will be shown when compiling _testcapi.c. I'll add a guard for that. If that's controversial, I'll gladly remove it.
(off-topic: since this is the only such warning shown, it seems that we never actually test deprecated functionality of the C API, which is worrying)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| destructor tp_finalize; | ||
| vectorcallfunc tp_vectorcall; | ||
|
|
||
| /* Unused, kept for backwards compatibility in CPython 3.8 only */ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please mention that it will be removed from Python 3.8. You may add "bpo-37250: " prefix.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| * Py_DEPRECATED(3.4) typedef int T1; | ||
| * Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void); | ||
| */ | ||
| #ifndef Py_DEPRECATED |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why do you modify pyport.h?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
IMHO it's fine if compiling _testcapimodule.c emits a deprecation warning. If it becomes an issue, we can just remove the test.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
IMHO it's fine if compiling _testcapimodule.c emits a deprecation warning.
The more warnings are shown, the less value there is in those warnings. A single warning during compilation stands out, an additional warning in between many not. So we should strive for compiling CPython without any warnings.
If it becomes an issue, we can just remove the test.
I think that's the worst solution. We typically test deprecated functionality in pure Python modules, why shouldn't we test deprecated C API?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reading https://stackoverflow.com/questions/13459602/how-can-i-get-rid-of-deprecated-warnings-in-deprecated-functions-in-gcc/ suggests there are a few ways we can go here:
_Py_PUSH_PRAGMA_IGNORE_DEPRECATION_WARNINGS and _Py_POP_PRAGMA macros and use those to selectively silence compiler warningsFor right now, I'd suggest seeing if the warning goes away if you mark the testcapi module's init function as deprecated.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Will do. Thanks to everyone involved! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.