Commit Graph

118180 Commits

Author SHA1 Message Date
Mark Shannon 494e3d4436
GH-107774: Add missing audit event for PEP 669 (GH-107775) 2023-08-10 12:29:06 +01:00
Erlend E. Aasland 39ef93edb9
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>
2023-08-10 07:19:05 +00:00
denballakh 4845b9712f
gh-107409: set `__wrapped__` attribute in `reprlib.recursive_repr` (#107410)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2023-08-10 06:55:49 +00:00
Kostya Farber 0f2fb6efb4
gh-107689: Add docstring to `ctypes.Array` (#107697) 2023-08-10 06:39:14 +00:00
Guido van Rossum 4890bfe1f9
Update README for the cases generator (#107826) 2023-08-10 01:05:51 +00:00
Mina Galić f50c17243a
GH-107812: extend `socket`'s netlink support to FreeBSD (gh-107813) 2023-08-10 00:47:46 +00:00
Carl Meyer 2ec16fed14
gh-91054: make code watcher tests resilient to other watchers (#107821) 2023-08-09 16:42:32 -06:00
Max Bachmann 1e229e2c3d
gh-107814: Avoid output from Nuget installation in find_python.bat (GH-107815) 2023-08-09 23:42:16 +01:00
Brandt Bucher 326f0ba1c5
GH-106485: Dematerialize instance dictionaries when possible (GH-106539) 2023-08-09 19:14:50 +00:00
Brandt Bucher a9caf9cf90
GH-105848: Simplify the arrangement of CALL's stack (GH-107788) 2023-08-09 18:19:39 +00:00
Erlend E. Aasland 0a7f48b9a8
gh-95065: Produce nicer deprecation messages in Argument Clinic (#107808) 2023-08-09 13:28:18 +00:00
Erlend E. Aasland 1b3f5f24af
gh-104683: Argument Clinic: Params now render their own docstrings (#107790)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-09 12:44:26 +00:00
Alex Waygood 65ce3652fa
gh-104683: Remove unused variables from `Tools/clinic` and tests for `Tools/clinic` (#107771) 2023-08-09 11:24:05 +01:00
Mark Shannon 52fbcf61b5
GH-107724: Fix the signature of `PY_THROW` callback functions. (GH-107725) 2023-08-09 09:30:50 +01:00
Raymond Hettinger 2fb484e625
Future-proof helper function with zero handling. (GH-107798) 2023-08-09 08:44:43 +01:00
Erlend E. Aasland 34cafd35e3
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
2023-08-09 09:43:02 +02:00
Erlend E. Aasland 925bbc2166
gh-80282: Argument Clinic: Add clarifying comment about ASCII docstring limitation (#107764)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-09 07:55:34 +02:00
Serhiy Storchaka 7b6e34e5ba
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.
2023-08-09 08:47:57 +03:00
Erlend E. Aasland 73507382ac
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>
2023-08-08 21:12:35 +00:00
Erlend E. Aasland 0be3743f54
gh-104683: Add --exclude option to Argument Clinic CLI (#107770)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-08 20:50:54 +00:00
Brandt Bucher ea72c6fe3b
GH-107596: Specialize str[int] (GH-107597) 2023-08-08 13:42:43 -07:00
Raymond Hettinger aab6f7173a
GH-100425: Note improved commutativity in sum(). (GH-107785) 2023-08-08 18:30:33 +01:00
Raymond Hettinger d4ac094cf9
Minor accuracy improvement for statistics.correlation() (GH-107781) 2023-08-08 17:12:52 +01:00
Eric Snow f9e3ff1ea4
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.
2023-08-08 09:52:13 -06:00
Fatih 906b73be5e
gh-91795: Update build optimization part of PCbuild/readme.txt (GH-91849) 2023-08-08 13:47:15 +01:00
Alex Waygood 7c5153de5a
gh-106368: Argument clinic: add tests for more failure paths (#107731) 2023-08-08 12:12:49 +00:00
Erlend E. Aasland 5df8b0d5c7
gh-95065: Argument Clinic: Add comment to preprocessor warning code (#107766) 2023-08-08 08:43:41 +00:00
Tomas R de72677f8a
gh-107659: Add docstrings for ctypes.pointer and ctypes.POINTER (#107660) 2023-08-08 08:20:10 +00:00
Inada Naoki 7a250fdc16
README: remove unmaintained sections (#107703) 2023-08-08 16:37:45 +09:00
Erlend E. Aasland a9aeb99579
gh-86457: Add docs for Argument Clinic @text_signature directive (#107747)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-08 08:42:08 +02:00
Erlend E. Aasland 0db043dd5a
gh-95065: Make Argument Clinic append deprecation warnings to docstrings (#107745) 2023-08-08 08:41:09 +02:00
Guido van Rossum 328d925244
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.
2023-08-07 21:36:25 -07:00
Guido van Rossum 2df58dcd50
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 **`).
2023-08-07 21:32:42 -07:00
Eric Snow 707018cc75
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.
2023-08-07 17:10:57 -06:00
Eric Snow 5dc825d504
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.
2023-08-07 15:40:59 -06:00
Serhiy Storchaka 0191af97a6
gh-107735: Move just added C API tests to better place (GH-107743) 2023-08-07 21:04:11 +00:00
Serhiy Storchaka 0e6e32fb84
gh-86457: Fix signature for code.replace() (GH-23199)
Also add support of @text_signature in Argument Clinic.
2023-08-07 23:34:53 +03:00
Serhiy Storchaka bea5f93196
gh-107735: Add C API tests for PySys_GetObject() and PySys_SetObject() (GH-107736) 2023-08-07 22:29:01 +03:00
Eric Snow 430632d6f7
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.
2023-08-07 13:14:56 -06:00
Serhiy Storchaka 16c9415fba
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.
2023-08-07 18:51:43 +03:00
Gertjan van Zwieten 8579327879
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.
2023-08-07 18:24:02 +03:00
Serhiy Storchaka ed64204716
gh-106566: Optimize (?!) in regular expressions (GH-106567) 2023-08-07 18:09:56 +03:00
Serhiy Storchaka 50e3cc9748
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.
2023-08-07 17:38:55 +03:00
Erlend E. Aasland 835e388915
gh-95065: Argument Clinic: Pretty-print long C strings in generated code (#107712)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-07 14:33:52 +00:00
Nikita Sobolev 8fcee6b279
gh-107710: Speed up `logging.getHandlerNames` function (#107711) 2023-08-07 14:52:36 +01:00
Alex Waygood c399b5e1a5
gh-107713: Reduce usage of mocks in `test_clinic.py` (#107714) 2023-08-07 14:26:49 +01:00
Erlend E. Aasland 8c9af6b9a0
Docs: Fix more Sphinx annotations in ctypes.rst (#107708) 2023-08-07 15:11:05 +02:00
Alex Waygood 2ac103c346
gh-85160: Reduce memory usage of `singledispatchmethod` (#107706)
A small followup to #107148

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-07 13:46:36 +01:00
Erlend E. Aasland 33cb0b06ef
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>
2023-08-07 11:28:08 +00:00
Serhiy Storchaka 3c8e8f3cee
gh-104496: Use correct Tcl or Tk version in Tkinter tests (GH-107688)
In future Tcl and Tk versions can be desynchronized.
2023-08-07 14:11:39 +03:00