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 — bpo-39947: revert incorrect change to a comment by iritkatriel · Pull Request #26788 · python/cpython Conversation
|
|
I'm not sure that this change is correct.
Right. But _PyTrash_begin/_PyTrash_end became regular functions, so _PyTrash_thread_deposit_object() and _PyTrash_thread_destroy_chain() don't need to be exported. They are only exported for the stable ABI. Maybe the export commands should be moved into object.c? These functions don't need technically to be part of the API. cc @encukou |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I see. I read the comment to mean "this is no longer used", which I found confusing. While we're here - do we need to keep the bodies of functions that we keep only for the ABI? Or could we replace the bodies of _PyTrash_deposit_object and _PyTrash_destroy_chain (which are really unused) with a comment saying "this is no longer used, left here for the stable ABI..." ? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm not that familiar with PyThrash, but the general idea is that macros are compiled into extensions, so extensions will do whatever the macros did in older versions of Python. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Until Python 3.8, Py_TRASHCAN_BEGIN_CONDITION emitted a call to the _PyTrash_thread_deposit_object() function. So any C extension built with the stable ABI would call _PyTrash_thread_deposit_object() function at the ABI level. If you modify _PyTrash_thread_deposit_object() to make it a no-op function, it will break these C extensions. But. The Py_TRASHCAN_BEGIN_CONDITION API was not usable with the limited C API (on Python 3.8 and older) since it accessed to PyThreadState members like At the end, providing any backward compatibility with the stable ABI for Python 3.8 and older sounds useless and maybe we can simply remove the following 4 functions: For the trashcan changes, see: When I did these changes, I was afraid of breaking the C API, so I tried to reduce the risk by keeping _PyTrash_thread_deposit_object() and _PyTrash_thread_destroy_chain() "just in case". I was not brave enough to remove them. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
That sounds correct. Let's remove them from 3.11? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Ok, I created PR #26869 to remove the 4 functions. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I merged my PR and so removed these 4 functions. Thanks for the reminder @iritkatriel ;-) |
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.