]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-107782: Pydoc: fall back to __text_signature__ if inspect.signature() fails (GH...
Serhiy Storchaka [Fri, 11 Aug 2023 17:51:36 +0000 (20:51 +0300)] 
gh-107782: Pydoc: fall back to __text_signature__ if inspect.signature() fails (GH-107786)

It allows to show signatures which are not representable in Python,
e.g. for getattr and dict.pop.

2 years agogh-106558: break ref cycles through exceptions in multiprocessing manager (#106559)
Andrew Geng [Fri, 11 Aug 2023 17:44:18 +0000 (13:44 -0400)] 
gh-106558: break ref cycles through exceptions in  multiprocessing manager (#106559)

2 years agogh-105481: split opcode_ids.h out of opcode.h so that it can be generated separately...
Irit Katriel [Fri, 11 Aug 2023 16:42:01 +0000 (17:42 +0100)] 
gh-105481: split opcode_ids.h out of opcode.h so that it can be generated separately (#107866)

2 years agoExtend _sqrtprod() to cover the full range of inputs. Add tests. (GH-107855)
Raymond Hettinger [Fri, 11 Aug 2023 16:19:19 +0000 (17:19 +0100)] 
Extend _sqrtprod() to cover the full range of inputs. Add tests. (GH-107855)

2 years agoDocs: Document PyBUF_MAX_NDIM (#107865)
Erlend E. Aasland [Fri, 11 Aug 2023 16:03:53 +0000 (18:03 +0200)] 
Docs: Document PyBUF_MAX_NDIM (#107865)

2 years agogh-84805: Autogenerate signature for METH_NOARGS and METH_O extension functions ...
Serhiy Storchaka [Fri, 11 Aug 2023 15:08:38 +0000 (18:08 +0300)] 
gh-84805: Autogenerate signature for METH_NOARGS and METH_O extension functions (GH-107794)

2 years agogh-107421: Clarify `OrderedDict` Examples and Recipes (#107613)
shailshouryya [Fri, 11 Aug 2023 04:43:13 +0000 (21:43 -0700)] 
gh-107421: Clarify `OrderedDict` Examples and Recipes (#107613)

2 years agoFix the long64 reader in umarshal.py (GH-107828)
Martin DeMello [Thu, 10 Aug 2023 20:43:14 +0000 (13:43 -0700)] 
Fix the long64 reader in umarshal.py (GH-107828)

2 years agogh-107810: Improve DeprecationWarning for metaclasses with custom tp_new (GH-107834)
Marc Mueller [Thu, 10 Aug 2023 15:55:47 +0000 (17:55 +0200)] 
gh-107810: Improve DeprecationWarning for metaclasses with custom tp_new (GH-107834)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2 years agogh-107838: In dataclasses, improve error message when a non-default field follows...
Eric V. Smith [Thu, 10 Aug 2023 14:39:13 +0000 (09:39 -0500)] 
gh-107838: In dataclasses, improve error message when a non-default field follows a default field. (gh-107842)

Add the name of the previous default argument field in an error message.

2 years agoGH-107674: Avoid allocating boxed ints for `sys.settrace` line events (GH-107780)
Mark Shannon [Thu, 10 Aug 2023 12:35:02 +0000 (13:35 +0100)] 
GH-107674: Avoid allocating boxed ints for `sys.settrace` line events (GH-107780)

2 years agoGH-106485: Handle dict subclasses correctly when dematerializing `__dict__` (GH-107837)
Mark Shannon [Thu, 10 Aug 2023 12:34:00 +0000 (13:34 +0100)] 
GH-106485: Handle dict subclasses correctly when dematerializing `__dict__` (GH-107837)

2 years agogh-106149: move CFG and basicblock definitions into flowgraph.c, use them as opaque...
Irit Katriel [Thu, 10 Aug 2023 12:03:47 +0000 (13:03 +0100)] 
gh-106149: move CFG and basicblock definitions into flowgraph.c, use them as opaque types in compile.c (#107639)

2 years agoGH-107774: Add missing audit event for PEP 669 (GH-107775)
Mark Shannon [Thu, 10 Aug 2023 11:29:06 +0000 (12:29 +0100)] 
GH-107774: Add missing audit event for PEP 669 (GH-107775)

2 years agogh-95065: Argument Clinic: Add functional tests of deprecated positionals (#107768)
Erlend E. Aasland [Thu, 10 Aug 2023 07:19:05 +0000 (09:19 +0200)] 
gh-95065: Argument Clinic: Add functional tests of deprecated positionals (#107768)

Move the "deprecated positinal" tests from clinic.test.c to
_testclinic.c. Mock PY_VERSION_HEX in order to prevent generated
compiler warnings/errors to trigger. Put clinic code for deprecated
positionals in Modules/clinic/_testclinic_depr_star.c.h for easy
inspection of the generated code.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-107409: set `__wrapped__` attribute in `reprlib.recursive_repr` (#107410)
denballakh [Thu, 10 Aug 2023 06:55:49 +0000 (11:55 +0500)] 
gh-107409: set `__wrapped__` attribute in `reprlib.recursive_repr` (#107410)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 years agogh-107689: Add docstring to `ctypes.Array` (#107697)
Kostya Farber [Thu, 10 Aug 2023 06:39:14 +0000 (07:39 +0100)] 
gh-107689: Add docstring to `ctypes.Array` (#107697)

2 years agoUpdate README for the cases generator (#107826)
Guido van Rossum [Thu, 10 Aug 2023 01:05:51 +0000 (18:05 -0700)] 
Update README for the cases generator (#107826)

2 years agoGH-107812: extend `socket`'s netlink support to FreeBSD (gh-107813)
Mina Galić [Thu, 10 Aug 2023 00:47:46 +0000 (01:47 +0100)] 
GH-107812: extend `socket`'s netlink support to FreeBSD (gh-107813)

2 years agogh-91054: make code watcher tests resilient to other watchers (#107821)
Carl Meyer [Wed, 9 Aug 2023 22:42:32 +0000 (16:42 -0600)] 
gh-91054: make code watcher tests resilient to other watchers (#107821)

2 years agogh-107814: Avoid output from Nuget installation in find_python.bat (GH-107815)
Max Bachmann [Wed, 9 Aug 2023 22:42:16 +0000 (00:42 +0200)] 
gh-107814: Avoid output from Nuget installation in find_python.bat (GH-107815)

2 years agoGH-106485: Dematerialize instance dictionaries when possible (GH-106539)
Brandt Bucher [Wed, 9 Aug 2023 19:14:50 +0000 (12:14 -0700)] 
GH-106485: Dematerialize instance dictionaries when possible (GH-106539)

2 years agoGH-105848: Simplify the arrangement of CALL's stack (GH-107788)
Brandt Bucher [Wed, 9 Aug 2023 18:19:39 +0000 (11:19 -0700)] 
GH-105848: Simplify the arrangement of CALL's stack (GH-107788)

2 years agogh-95065: Produce nicer deprecation messages in Argument Clinic (#107808)
Erlend E. Aasland [Wed, 9 Aug 2023 13:28:18 +0000 (15:28 +0200)] 
gh-95065: Produce nicer deprecation messages in Argument Clinic (#107808)

2 years agogh-104683: Argument Clinic: Params now render their own docstrings (#107790)
Erlend E. Aasland [Wed, 9 Aug 2023 12:44:26 +0000 (14:44 +0200)] 
gh-104683: Argument Clinic: Params now render their own docstrings (#107790)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-104683: Remove unused variables from `Tools/clinic` and tests for `Tools/clinic...
Alex Waygood [Wed, 9 Aug 2023 10:24:05 +0000 (11:24 +0100)] 
gh-104683: Remove unused variables from `Tools/clinic` and tests for `Tools/clinic` (#107771)

2 years agoGH-107724: Fix the signature of `PY_THROW` callback functions. (GH-107725)
Mark Shannon [Wed, 9 Aug 2023 08:30:50 +0000 (09:30 +0100)] 
GH-107724: Fix the signature of `PY_THROW` callback functions. (GH-107725)

2 years agoFuture-proof helper function with zero handling. (GH-107798)
Raymond Hettinger [Wed, 9 Aug 2023 07:44:43 +0000 (08:44 +0100)] 
Future-proof helper function with zero handling. (GH-107798)

2 years agoDocs: clean up Argument Clinic howto's (#107797)
Erlend E. Aasland [Wed, 9 Aug 2023 07:43:02 +0000 (09:43 +0200)] 
Docs: clean up Argument Clinic howto's (#107797)

- fix formatting in @text_signature howto and NEWS entry
- fix formatting and example text in deprecate-positionals howto

2 years agogh-80282: Argument Clinic: Add clarifying comment about ASCII docstring limitation...
Erlend E. Aasland [Wed, 9 Aug 2023 05:55:34 +0000 (07:55 +0200)] 
gh-80282: Argument Clinic: Add clarifying comment about ASCII docstring limitation (#107764)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-106052: Fix bug in the matching of possessive quantifiers (gh-106515)
Serhiy Storchaka [Wed, 9 Aug 2023 05:47:57 +0000 (08:47 +0300)] 
gh-106052: Fix bug in the matching of possessive quantifiers (gh-106515)

It did not work in the case of a subpattern containing backtracking.

Temporary implement possessive quantifiers as equivalent greedy qualifiers
in atomic groups.

2 years agogh-104683: Argument Clinic: refactor format_docstring() (#107623)
Erlend E. Aasland [Tue, 8 Aug 2023 21:12:35 +0000 (23:12 +0200)] 
gh-104683: Argument Clinic: refactor format_docstring() (#107623)

Extract helper methods for formatting the signature and parameter
sections, and clean up the remaining function body.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years agogh-104683: Add --exclude option to Argument Clinic CLI (#107770)
Erlend E. Aasland [Tue, 8 Aug 2023 20:50:54 +0000 (22:50 +0200)] 
gh-104683: Add --exclude option to Argument Clinic CLI (#107770)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agoGH-107596: Specialize str[int] (GH-107597)
Brandt Bucher [Tue, 8 Aug 2023 20:42:43 +0000 (13:42 -0700)] 
GH-107596: Specialize str[int] (GH-107597)

2 years agoGH-100425: Note improved commutativity in sum(). (GH-107785)
Raymond Hettinger [Tue, 8 Aug 2023 17:30:33 +0000 (19:30 +0200)] 
GH-100425: Note improved commutativity in sum(). (GH-107785)

2 years agoMinor accuracy improvement for statistics.correlation() (GH-107781)
Raymond Hettinger [Tue, 8 Aug 2023 16:12:52 +0000 (18:12 +0200)] 
Minor accuracy improvement for statistics.correlation() (GH-107781)

2 years agogh-105699: Re-enable the Multiple-Interpreters Stress Tests (gh-107572)
Eric Snow [Tue, 8 Aug 2023 15:52:13 +0000 (09:52 -0600)] 
gh-105699: Re-enable the Multiple-Interpreters Stress Tests (gh-107572)

We had disabled them due to crashes they exposed, which have since been fixed.

2 years agogh-91795: Update build optimization part of PCbuild/readme.txt (GH-91849)
Fatih [Tue, 8 Aug 2023 12:47:15 +0000 (15:47 +0300)] 
gh-91795: Update build optimization part of PCbuild/readme.txt (GH-91849)

2 years agogh-106368: Argument clinic: add tests for more failure paths (#107731)
Alex Waygood [Tue, 8 Aug 2023 12:12:49 +0000 (13:12 +0100)] 
gh-106368: Argument clinic: add tests for more failure paths (#107731)

2 years agogh-95065: Argument Clinic: Add comment to preprocessor warning code (#107766)
Erlend E. Aasland [Tue, 8 Aug 2023 08:43:41 +0000 (10:43 +0200)] 
gh-95065: Argument Clinic: Add comment to preprocessor warning code (#107766)

2 years agogh-107659: Add docstrings for ctypes.pointer and ctypes.POINTER (#107660)
Tomas R [Tue, 8 Aug 2023 08:20:10 +0000 (10:20 +0200)] 
gh-107659: Add docstrings for ctypes.pointer and ctypes.POINTER (#107660)

2 years agoREADME: remove unmaintained sections (#107703)
Inada Naoki [Tue, 8 Aug 2023 07:37:45 +0000 (16:37 +0900)] 
README: remove unmaintained sections (#107703)

2 years agogh-86457: Add docs for Argument Clinic @text_signature directive (#107747)
Erlend E. Aasland [Tue, 8 Aug 2023 06:42:08 +0000 (08:42 +0200)] 
gh-86457: Add docs for Argument Clinic @text_signature directive (#107747)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-95065: Make Argument Clinic append deprecation warnings to docstrings (#107745)
Erlend E. Aasland [Tue, 8 Aug 2023 06:41:09 +0000 (08:41 +0200)] 
gh-95065: Make Argument Clinic append deprecation warnings to docstrings (#107745)

2 years agogh-107758: Improvements to lltrace feature (#107757)
Guido van Rossum [Tue, 8 Aug 2023 04:36:25 +0000 (21:36 -0700)] 
gh-107758: Improvements to lltrace feature (#107757)

- The `dump_stack()` method could call a `__repr__` method implemented in Python,
  causing (infinite) recursion.
  I rewrote it to only print out the values for some fundamental types (`int`, `str`, etc.);
  for everything else it just prints `<type_name @ 0xdeadbeef>`.

- The lltrace-like feature for uops wrote to `stderr`, while the one in `ceval.c` writes to `stdout`;
  I changed the uops to write to stdout as well.

2 years agogh-106812: Small stack effect fixes (#107759)
Guido van Rossum [Tue, 8 Aug 2023 04:32:42 +0000 (21:32 -0700)] 
gh-106812: Small stack effect fixes (#107759)

- Generalize the syntax for the type of a stack effect to allow a trailing `*`,
  so we can declare something as e.g. `PyCodeObject *`.

- When generating assignments for stack effects,
  the type of the value on the stack should be the default (i.e., `PyObject *`)
  even when the variable copied to/from it has a different type,
  so that an appropriate cast is generated
  However, not when the variable is an array --
  then the type is taken from the variable (as it is always `PyObject **`).

2 years agogh-107630: Fix Remaining Subinterpreters Crashes on Py_TRACE_REFS Builds (gh-107750)
Eric Snow [Mon, 7 Aug 2023 23:10:57 +0000 (17:10 -0600)] 
gh-107630: Fix Remaining Subinterpreters Crashes on Py_TRACE_REFS Builds (gh-107750)

This is a follow-up to gh-107567 and gh-107733.

We skip test_basic_multiple_interpreters_deleted_no_reset on tracerefs builds.  The test breaks interpreter isolation a little, which doesn't work well with Py_TRACE_REFS builds, so I feel fine about skipping the test.

2 years agogh-98154: Clarify Usage of "Reference Count" In the Docs (gh-107552)
Eric Snow [Mon, 7 Aug 2023 21:40:59 +0000 (15:40 -0600)] 
gh-98154: Clarify Usage of "Reference Count" In the Docs (gh-107552)

PEP 683 (immortal objects) revealed some ways in which the Python documentation has been unnecessarily coupled to the implementation details of reference counts.  In the end users should focus on reference ownership, including taking references and releasing them, rather than on how many reference counts an object has.

This change updates the documentation to reflect that perspective.  It also updates the docs relative to immortal objects in a handful of places.

2 years agogh-107735: Move just added C API tests to better place (GH-107743)
Serhiy Storchaka [Mon, 7 Aug 2023 21:04:11 +0000 (00:04 +0300)] 
gh-107735: Move just added C API tests to better place (GH-107743)

2 years agogh-86457: Fix signature for code.replace() (GH-23199)
Serhiy Storchaka [Mon, 7 Aug 2023 20:34:53 +0000 (23:34 +0300)] 
gh-86457: Fix signature for code.replace() (GH-23199)

Also add support of @text_signature in Argument Clinic.

2 years agogh-107735: Add C API tests for PySys_GetObject() and PySys_SetObject() (GH-107736)
Serhiy Storchaka [Mon, 7 Aug 2023 19:29:01 +0000 (22:29 +0300)] 
gh-107735: Add C API tests for PySys_GetObject() and PySys_SetObject() (GH-107736)

2 years agogh-107630: Initialize Each Interpreter's refchain Properly (gh-107733)
Eric Snow [Mon, 7 Aug 2023 19:14:56 +0000 (13:14 -0600)] 
gh-107630: Initialize Each Interpreter's refchain Properly (gh-107733)

This finishes fixing the crashes in Py_TRACE_REFS builds.  We missed this part in gh-107567.

2 years agogh-107178: Add the C API tests for the Abstract Objects Layer (GH-107179)
Serhiy Storchaka [Mon, 7 Aug 2023 15:51:43 +0000 (18:51 +0300)] 
gh-107178: Add the C API tests for the Abstract Objects Layer (GH-107179)

Cover all the Mapping Protocol, almost all the Sequence Protocol
(except PySequence_Fast) and a part of the Object Protocol.

Move existing tests to Lib/test/test_capi/test_abstract.py and
Modules/_testcapi/abstract.c.

Add also tests for PyDict C API.

2 years agogh-107715: Escape class name in regular expression (GH-107716)
Gertjan van Zwieten [Mon, 7 Aug 2023 15:24:02 +0000 (18:24 +0300)] 
gh-107715: Escape class name in regular expression (GH-107716)

This patch escapes the class name before embedding it in the regular expression
for `pat` in `doctest.DocTestFinder._find_lineno`. While class names do not
ordinarily contain special characters, it is possible to encounter these when a
class is created dynamically. Escaping the name will correctly return `None` in
this scenario, rather than potentially matching a different class or raising
`re.error` depending on the symbols used.

2 years agogh-106566: Optimize (?!) in regular expressions (GH-106567)
Serhiy Storchaka [Mon, 7 Aug 2023 15:09:56 +0000 (18:09 +0300)] 
gh-106566: Optimize (?!) in regular expressions (GH-106567)

2 years agogh-100814: Fix exception for invalid callable value of Tkinter image option (GH-107692)
Serhiy Storchaka [Mon, 7 Aug 2023 14:38:55 +0000 (17:38 +0300)] 
gh-100814: Fix exception for invalid callable value of Tkinter image option (GH-107692)

Passing a callable object as an option value to a Tkinter image now raises
the expected TclError instead of an AttributeError.

2 years agogh-95065: Argument Clinic: Pretty-print long C strings in generated code (#107712)
Erlend E. Aasland [Mon, 7 Aug 2023 14:33:52 +0000 (16:33 +0200)] 
gh-95065: Argument Clinic: Pretty-print long C strings in generated code (#107712)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-107710: Speed up `logging.getHandlerNames` function (#107711)
Nikita Sobolev [Mon, 7 Aug 2023 13:52:36 +0000 (16:52 +0300)] 
gh-107710: Speed up `logging.getHandlerNames` function (#107711)

2 years agogh-107713: Reduce usage of mocks in `test_clinic.py` (#107714)
Alex Waygood [Mon, 7 Aug 2023 13:26:49 +0000 (14:26 +0100)] 
gh-107713: Reduce usage of mocks in `test_clinic.py` (#107714)

2 years agoDocs: Fix more Sphinx annotations in ctypes.rst (#107708)
Erlend E. Aasland [Mon, 7 Aug 2023 13:11:05 +0000 (15:11 +0200)] 
Docs: Fix more Sphinx annotations in ctypes.rst (#107708)

2 years agogh-85160: Reduce memory usage of `singledispatchmethod` (#107706)
Alex Waygood [Mon, 7 Aug 2023 12:46:36 +0000 (13:46 +0100)] 
gh-85160: Reduce memory usage of `singledispatchmethod` (#107706)

A small followup to #107148

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-95065: Add Argument Clinic support for deprecating positional use of parameters...
Erlend E. Aasland [Mon, 7 Aug 2023 11:28:08 +0000 (13:28 +0200)] 
gh-95065: Add Argument Clinic support for deprecating positional use of parameters (#95151)

It is now possible to deprecate passing parameters positionally with
Argument Clinic, using the new '* [from X.Y]' syntax.
(To be read as "keyword-only from Python version X.Y")

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-104496: Use correct Tcl or Tk version in Tkinter tests (GH-107688)
Serhiy Storchaka [Mon, 7 Aug 2023 11:11:39 +0000 (14:11 +0300)] 
gh-104496: Use correct Tcl or Tk version in Tkinter tests (GH-107688)

In future Tcl and Tk versions can be desynchronized.

2 years agogh-107442: Document all valid types for ctypes _as_parameter_ (#107443)
Tomas R [Mon, 7 Aug 2023 10:41:39 +0000 (12:41 +0200)] 
gh-107442: Document all valid types for ctypes _as_parameter_ (#107443)

2 years agoDocs: Argument Clinic: Move the CConverter class to the reference (#107671)
Erlend E. Aasland [Mon, 7 Aug 2023 00:08:34 +0000 (02:08 +0200)] 
Docs: Argument Clinic: Move the CConverter class to the reference (#107671)

2 years agoImprove cross-references in `runpy` docs (#107673)
Kamil Turek [Sun, 6 Aug 2023 21:11:16 +0000 (23:11 +0200)] 
Improve cross-references in `runpy` docs (#107673)

- Add links to `__main__` and `sys.path` where appropriate
- Ensure each paragraph never has more than one link to the same thing, to avoid visual clutter from too many links

2 years agogh-106368: Improve coverage reports for argument clinic (#107693)
Alex Waygood [Sun, 6 Aug 2023 19:40:55 +0000 (20:40 +0100)] 
gh-106368: Improve coverage reports for argument clinic (#107693)

2 years agoDo not use deprecated ``logger.warn()`` in pyspecific (#107694)
Adam Turner [Sun, 6 Aug 2023 13:58:00 +0000 (14:58 +0100)] 
Do not use deprecated ``logger.warn()`` in pyspecific (#107694)

2 years agogh-85160: improve performance of `functools.singledispatchmethod` (#107148)
Pieter Eendebak [Sun, 6 Aug 2023 12:37:12 +0000 (14:37 +0200)] 
gh-85160: improve performance of `functools.singledispatchmethod` (#107148)

Co-authored-by: mental <m3nta1@yahoo.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoDocs: skip python-docs-theme 2023.7 to fix mobile menu (#107666)
Hugo van Kemenade [Sun, 6 Aug 2023 11:08:32 +0000 (13:08 +0200)] 
Docs: skip python-docs-theme 2023.7 to fix mobile menu (#107666)

2 years agoDocs: Fix Sphinx annotations in Doc/library/ctypes.rst (#107672)
Erlend E. Aasland [Sun, 6 Aug 2023 08:23:50 +0000 (10:23 +0200)] 
Docs: Fix Sphinx annotations in Doc/library/ctypes.rst (#107672)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years agoGH-84435: Make pyspecific directives translatable (#19470)
cocoatomo [Sun, 6 Aug 2023 05:10:50 +0000 (14:10 +0900)] 
GH-84435: Make pyspecific directives translatable (#19470)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2 years agogh-104683: Improve consistency and test coverage of argument-clinic `__repr__` functi...
Alex Waygood [Sat, 5 Aug 2023 20:58:38 +0000 (21:58 +0100)] 
gh-104683: Improve consistency and test coverage of argument-clinic `__repr__` functions (#107667)

2 years agoDocs: Argument Clinic: Improve 'How to write a custom converter' (#107328)
Erlend E. Aasland [Sat, 5 Aug 2023 20:19:37 +0000 (22:19 +0200)] 
Docs: Argument Clinic: Improve 'How to write a custom converter' (#107328)

- Omit unneccesary wording and sentences
- Don't mention implementation details (no digression, explanation)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2 years agogh-107662: Switch 'any' and 'anext' in functions.rst (#107663)
Terry Jan Reedy [Sat, 5 Aug 2023 14:38:20 +0000 (10:38 -0400)] 
gh-107662: Switch 'any' and 'anext' in functions.rst (#107663)

Order was reversed in index at top, not in body.

2 years agoGH-106684: raise `ResourceWarning` when `asyncio.StreamWriter` is not closed (#107650)
Kumar Aditya [Sat, 5 Aug 2023 12:18:15 +0000 (17:48 +0530)] 
GH-106684: raise `ResourceWarning` when `asyncio.StreamWriter` is not closed (#107650)

2 years agogh-107432 Fix incorrect indentation in annotations HOWTO (#107445)
Daniele Procida [Sat, 5 Aug 2023 11:28:28 +0000 (13:28 +0200)] 
gh-107432 Fix incorrect indentation in annotations HOWTO (#107445)

gh-107432 Fix incorrect indentation in annotations document

Body text in https://docs.python.org/3/howto/annotations.html was
indented throughout, and was being rendered in blockquote elements.

2 years agogh-106812: Fix two tiny bugs in analysis.py (#107649)
Guido van Rossum [Sat, 5 Aug 2023 04:50:36 +0000 (21:50 -0700)] 
gh-106812: Fix two tiny bugs in analysis.py (#107649)

This fixes two tiny defects in analysis.py that I didn't catch on time in #107564:

- `get_var_names` in `check_macro_consistency` should skip `UNUSED` names.
- Fix an occurrence of `is UNUSED` (should be `==`).

2 years agogh-106608: make uop trace variable length (#107531)
Ivin Lee [Sat, 5 Aug 2023 04:10:46 +0000 (12:10 +0800)] 
gh-106608: make uop trace variable length (#107531)

Executors are now more like tuples.

2 years agoGH-84436: Skip refcounting for known immortals (GH-107605)
Brandt Bucher [Fri, 4 Aug 2023 23:24:50 +0000 (16:24 -0700)] 
GH-84436: Skip refcounting for known immortals (GH-107605)

2 years agoGH-70303: Emit FutureWarning when pathlib glob pattern ends with `**` (GH-105413)
Barney Gale [Fri, 4 Aug 2023 23:12:12 +0000 (00:12 +0100)] 
GH-70303: Emit FutureWarning when pathlib glob pattern ends with `**` (GH-105413)

In a future Python release, patterns with this ending will match both files
and directories. Users may add a trailing slash to remove the warning.

2 years agogh-106368: Argument clinic: improve coverage for `self.valid_line()` calls (#107641)
Alex Waygood [Fri, 4 Aug 2023 19:41:04 +0000 (20:41 +0100)] 
gh-106368: Argument clinic: improve coverage for `self.valid_line()` calls (#107641)

2 years agoDocs: Only include Plausible for html, not for epub etc (#107637)
Hugo van Kemenade [Fri, 4 Aug 2023 18:33:34 +0000 (21:33 +0300)] 
Docs: Only include Plausible for html, not for epub etc (#107637)

Only include Plausible for html, not for epub etc

2 years agogh-104683: Argument Clinic: Use CConverter.length_name where possible (#107638)
Erlend E. Aasland [Fri, 4 Aug 2023 17:49:07 +0000 (19:49 +0200)] 
gh-104683: Argument Clinic: Use CConverter.length_name where possible (#107638)

Also make it a cached property.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-106812: Refactor cases_generator to allow uops with array stack effects (#107564)
Guido van Rossum [Fri, 4 Aug 2023 16:35:56 +0000 (09:35 -0700)] 
gh-106812: Refactor cases_generator to allow uops with array stack effects (#107564)

Introducing a new file, stacking.py, that takes over several responsibilities related to symbolic evaluation of push/pop operations, with more generality.

2 years agogh-104146: Argument clinic: remove dead code highlighted by the `vulture` tool (...
Alex Waygood [Fri, 4 Aug 2023 14:56:50 +0000 (15:56 +0100)] 
gh-104146: Argument clinic: remove dead code highlighted by the `vulture` tool (#107632)

2 years agogh-107600: Docs: Update ctypes.ArgumentError error message (#107601)
Tomas R [Fri, 4 Aug 2023 14:34:04 +0000 (16:34 +0200)] 
gh-107600: Docs: Update ctypes.ArgumentError error message (#107601)

2 years agoDocs: upgrade to python-docs-theme 2023.7 (#107617)
Hugo van Kemenade [Fri, 4 Aug 2023 14:16:10 +0000 (17:16 +0300)] 
Docs: upgrade to python-docs-theme 2023.7 (#107617)

2 years agogh-104146: Argument clinic: Remove dead code flagged by mypy's `truthy-bool` check...
Alex Waygood [Fri, 4 Aug 2023 13:28:13 +0000 (14:28 +0100)] 
gh-104146: Argument clinic: Remove dead code flagged by mypy's `truthy-bool` check (#107627)

2 years agogh-107614: Normalise Argument Clinic error messages (#107615)
Erlend E. Aasland [Fri, 4 Aug 2023 12:13:10 +0000 (14:13 +0200)] 
gh-107614: Normalise Argument Clinic error messages (#107615)

- always wrap the offending line, token, or name in quotes
- in most cases, put the entire error message on one line

Added tests for uncovered branches that were touched by this PR.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agoAdd some GC stats to Py_STATS (GH-107581)
Mark Shannon [Fri, 4 Aug 2023 09:34:23 +0000 (10:34 +0100)] 
Add some GC stats to Py_STATS (GH-107581)

2 years agoGH-107263: Increase C stack limit for most functions, except `_PyEval_EvalFrameDefaul...
Mark Shannon [Fri, 4 Aug 2023 09:10:29 +0000 (10:10 +0100)] 
GH-107263: Increase C stack limit for most functions, except `_PyEval_EvalFrameDefault()` (GH-107535)

* Set C recursion limit to 1500, set cost of eval loop to 2 frames, and compiler mutliply to 2.

2 years agogh-106368: Increase Argument Clinic test coverage (#107611)
Erlend E. Aasland [Fri, 4 Aug 2023 07:48:32 +0000 (09:48 +0200)] 
gh-106368: Increase Argument Clinic test coverage (#107611)

Add tests for directives and destinations

2 years agogh-107609: Fix duplicate module check in Argument Clinic (#107610)
Erlend E. Aasland [Fri, 4 Aug 2023 05:28:25 +0000 (07:28 +0200)] 
gh-107609: Fix duplicate module check in Argument Clinic (#107610)

Also remove duplicate module def from _testcapi.

2 years agoGH-105481: Mark more files as generated (GH-107598)
Brandt Bucher [Fri, 4 Aug 2023 04:37:23 +0000 (21:37 -0700)] 
GH-105481: Mark more files as generated (GH-107598)

2 years agogh-104146: Argument clinic: remove unused methods and variables (#107608)
Alex Waygood [Fri, 4 Aug 2023 00:17:17 +0000 (01:17 +0100)] 
gh-104146: Argument clinic: remove unused methods and variables (#107608)

2 years agogh-106368: Argument clinic tests: improve error message when `expect_success()` fails...
Alex Waygood [Thu, 3 Aug 2023 21:26:14 +0000 (22:26 +0100)] 
gh-106368: Argument clinic tests: improve error message when `expect_success()` fails (#107606)

2 years agogh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567)
Eric Snow [Thu, 3 Aug 2023 19:51:08 +0000 (13:51 -0600)] 
gh-107080: Fix Py_TRACE_REFS Crashes Under Isolated Subinterpreters (gh-107567)

The linked list of objects was a global variable, which broke isolation between interpreters, causing crashes. To solve this, we've moved the linked list to each interpreter.

2 years agogh-107446: Fix test_inspect.test_class_with_method_from_other_module when ran multipl...
Tian Gao [Thu, 3 Aug 2023 15:04:03 +0000 (07:04 -0800)] 
gh-107446: Fix test_inspect.test_class_with_method_from_other_module when ran multiple times (#107451)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2 years agogh-107576: Ensure `__orig_bases__` are our own in `get_original_bases` (#107584)
James Hilton-Balfe [Thu, 3 Aug 2023 14:19:24 +0000 (15:19 +0100)] 
gh-107576: Ensure `__orig_bases__` are our own in `get_original_bases` (#107584)

Co-authored-by: Chris Bouchard <chris@upliftinglemma.net>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>