| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Since last month, nobody replied to my question if PyUnstable_ExecutableKinds should be made public on purpose, or if this PyUnstable API should stay in the internal C API. If it should stay private, why calling it this way? PyUnstable_ExecutableKinds was added by @markshannon in commit 7199584. #define PY_EXECUTABLE_KIND_SKIP 0 #define PY_EXECUTABLE_KIND_PY_FUNCTION 1 #define PY_EXECUTABLE_KIND_BUILTIN_FUNCTION 3 #define PY_EXECUTABLE_KIND_METHOD_DESCRIPTOR 4 #define PY_EXECUTABLE_KINDS 5 Hum, should constants also be prefixed by PyUnstable_ if they are exposed in the public C API? Maybe they can keep this name in the internal C API. cc @encukou |
Sorry, something went wrong.
|
@gvanrossum: Does this change look good to you? If this API is too new and should "not be used" outside CPython code base, maybe the PyUnstable API should be removed instead? |
Sorry, something went wrong.
|
Note: this API is new in Python 3.13, Python 3.12 is not affected. |
Sorry, something went wrong.
I defer to @iritkatriel. Maybe it should have just been a private API, i.e. not using Unstable in its name? |
Sorry, something went wrong.
Possibly. @markshannon do you have a preference? |
Sorry, something went wrong.
Make your choice :-) |
Sorry, something went wrong.
|
If Mark doesn't have a different view, I'd make them private since that's easier to reverse. |
Sorry, something went wrong.
|
Let's not waste Mark's time. Let's make it private. |
Sorry, something went wrong.
Ok. I created PR #108651 to make the API private. Would you mind to review it? Thanks in advance.
Sure, later, we can easily make it public if some use cases arise! |
Sorry, something went wrong.
|
Hold on. I mixed up two PRs or issues of yours that both were related to PyUnstable. I see you already merged gh-108441 which is fine. Those are now public unstable. For this PR I think the API also needs to remain or belong public/unstable, since this API is needed for 3rd parties that are inspecting frames. They'll find this executable kind code and need to be able to understand what it means. So I retract my proposal/approval to make it private. |
Sorry, something went wrong.
|
@markshannon: So is that your PR what you propose? |
Sorry, something went wrong.
Move PyUnstable_ExecutableKinds and associated macros from the internal C API to the public C API. Rename constants: replace "PY_" prefix with "PyUnstable_" prefix.
|
I rebased the PR on the main branch and I renamed constants: replace PY_ prefix with PyUnstable_ prefix. |
Sorry, something went wrong.
|
@markshannon wants this API to be public, see his comment: #108651 (comment) |
Sorry, something went wrong.
|
The mixed case looks a bit strange. Is there a reason it can't be PY_UNSTABLE_...? |
Sorry, something went wrong.
cc @encukou who designed https://peps.python.org/pep-0689/ |
Sorry, something went wrong.
|
Most C API macros uses Py_ prefix (438), instead of the PY_ prefix (83): $ cd ~/python/main/Include $ git grep -E 'define Py_[A-Z_]+\>'|wc -l 438 $ git grep -E 'define PY_[A-Z_]+\>'|wc -l 83 I don't have a strong preference between PyUnstable_, PY_UNSTABLE_ or PYUNSTABLE_ prefix. |
Sorry, something went wrong.
|
See PEP-7:
So, it should be PyUnstable_EXECUTABLE_KIND_SKIP &c. |
Sorry, something went wrong.
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
|
Sorry, @vstinner, I could not cleanly backport this to 3.12 due to a conflict. |
Sorry, something went wrong.
Oops, I forgot my own comment :-) |
Sorry, something went wrong.
|
Thanks everybody for helping me to clarify the scope of this API :-) Thanks @encukou for helping me on the API prefix for constants (macros) :-) I merged my PR. |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot ARM Raspbian 3.x has failed when building commit 9c03215. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/424/builds/4780 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Tests result: FAILURE then FAILURE == 442 tests OK. 10 slowest tests:
1 test failed: 19 tests skipped: 1 re-run test: Total duration: 42 min 35 sec Click to see traceback logsTraceback (most recent call last):
File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_concurrent_futures/test_shutdown.py", line 49, in test_interpreter_shutdown
self.assertFalse(err)
AssertionError: b'Exception in thread Thread-1:\nTraceback (most recent call last):\n File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/threading.py", line 1059, in _bootstrap_inner\n self.run()\n File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/concurrent/futures/process.py", line 339, in run\n self.add_call_item_to_queue()\n File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/concurrent/futures/process.py", line 394, in add_call_item_to_queue\n self.call_queue.put(_CallItem(work_id,\n File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/multiprocessing/queues.py", line 94, in put\n self._start_thread()\n File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/multiprocessing/queues.py", line 177, in _start_thread\n self._thread.start()\n File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/threading.py", line 978, in start\n _start_new_thread(self._bootstrap, ())\nRuntimeError: can\'t create new thread at interpreter shutdown\nTraceback (most recent call last):\n File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/multiprocessing/forkserver.py", line 274, in main\n code = _serve_one(child_r, fds,\n ^^^^^^^^^^^^^^^^^^^^^^^^\n File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/multiprocessing/forkserver.py", line 313, in _serve_one\n code = spawn._main(child_r, parent_sentinel)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/multiprocessing/spawn.py", line 132, in _main\n self = reduction.pickle.load(from_parent)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/multiprocessing/synchronize.py", line 115, in __setstate__\n self._semlock = _multiprocessing.SemLock._rebuild(*state)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nFileNotFoundError: [Errno 2] No such file or directory\n' is not false
|
Sorry, something went wrong.
|
These were made public, but not documented. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Move PyUnstable_ExecutableKinds and associated macros from the internal C API to the public C API.