gh-141004: Reorganize and reword the 'Useful macros' section#144471
Conversation
- Group the macros - Roughly order them to put the most important ones first - Add expansions where it makes sense; especially if there's an equivalent in modern C or a common compiler
vstinner
left a comment
There was a problem hiding this comment.
Since you're already moving many functions, it may be interesting to sort functions in each category.
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
Sort by what? |
Sorry, something went wrong.
I'm thinking at the alphabetical order. |
Sorry, something went wrong.
|
More macros -- more structure. How does this version look? I've grouped them in categories, and sorted by relevance first, alphabet second. For example, FWIW, I think combined entries are a great way to reduce duplication for things that do almost the same thing: |
Sorry, something went wrong.
ZeroIntensity
left a comment
There was a problem hiding this comment.
Mostly LGTM, with two little things below.
Sorry, something went wrong.
vstinner
left a comment
There was a problem hiding this comment.
LGTM. I like the new organization.
Sorry, something went wrong.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
ZeroIntensity
left a comment
There was a problem hiding this comment.
LGTM as well, thanks for the cleanup!
Sorry, something went wrong.
f85e117
into
python:main
Feb 6, 2026
|
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
Sorry, something went wrong.
…ythonGH-144471) - Group the macros - Roughly order them to put the most important ones first - Add expansions where it makes sense; especially if there's an equivalent in modern C or a common compiler (cherry picked from commit f85e117) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
Sorry, @encukou, I could not cleanly backport this to |
Sorry, something went wrong.
…H-144471) (GH-144541) - Group the macros - Roughly order them to put the most important ones first - Add expansions where it makes sense; especially if there's an equivalent in modern C or a common compiler (cherry picked from commit f85e117) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot s390x Fedora Stable Refleaks 3.14 (tier-3) has failed when building commit 3fe9735. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/#/builders/1776/builds/892 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Click to see traceback logsTraceback (most recent call last):
File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-s390x.refleak/build/Lib/test/test_external_inspection.py", line 1246, in test_only_active_thread
self.assertEqual(
~~~~~~~~~~~~~~~~^
len(gil_traces), 1, "Should have exactly one GIL holder"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
AssertionError: 0 != 1 : Should have exactly one GIL holder
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-s390x.refleak/build/Lib/test/test_pyrepl/test_unix_console.py", line 390, in test_repl_eio
_, err = proc.communicate(timeout=support.LONG_TIMEOUT)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-s390x.refleak/build/Lib/subprocess.py", line 1220, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-s390x.refleak/build/Lib/subprocess.py", line 2153, in _communicate
self._check_timeout(endtime, orig_timeout, stdout, stderr)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-s390x.refleak/build/Lib/subprocess.py", line 1267, in _check_timeout
raise TimeoutExpired(
...<2 lines>...
stderr=b''.join(stderr_seq) if stderr_seq else None)
subprocess.TimeoutExpired: Command '['/home/buildbot/buildarea/3.14.cstratak-fedora-stable-s390x.refleak/build/python', '-E', '-S', '/home/buildbot/buildarea/3.14.cstratak-fedora-stable-s390x.refleak/build/Lib/test/test_pyrepl/eio_test_script.py']' timed out after 675.0 seconds
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-s390x.refleak/build/Lib/subprocess.py", line 1138, in __del__
_warn("subprocess %s is still running" % self.pid,
ResourceWarning: subprocess 2751248 is still running
Warning -- Unraisable exception
Exception ignored while finalizing file <_io.FileIO name=10 mode='rb' closefd=True>:
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-s390x.refleak/build/Lib/unittest/case.py", line 668, in run
with outcome.testPartExecutor(self):
ResourceWarning: unclosed file <_io.TextIOWrapper name=10 encoding='UTF-8'>
Warning -- Unraisable exception
Exception ignored while finalizing file <_io.FileIO name=8 mode='rb' closefd=True>:
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-s390x.refleak/build/Lib/unittest/case.py", line 668, in run
with outcome.testPartExecutor(self):
ResourceWarning: unclosed file <_io.TextIOWrapper name=8 encoding='UTF-8'>
|
Sorry, something went wrong.
|
I'm not planning to resolve 3.13 conflicts & backport to 3.13. The main point of docs backports beyond the current stable version is to make future backports easier (especially security issue fix docs), but in this part of the docs, complex changes don't seem too likely. |
Sorry, something went wrong.
…ythonGH-144471) - Group the macros - Roughly order them to put the most important ones first - Add expansions where it makes sense; especially if there's an equivalent in modern C or a common compiler Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
…ythonGH-144471) - Group the macros - Roughly order them to put the most important ones first - Add expansions where it makes sense; especially if there's an equivalent in modern C or a common compiler Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This is a follow-up to #143508. When all the public macros were documented, the section became somewhat unwieldy.
📚 Documentation preview 📚: https://cpython-previews--144471.org.readthedocs.build/