Commit Graph

118439 Commits

Author SHA1 Message Date
Adam Turner 5d936b6479
GH-108202: Combine documentation of ``calendar`` constants (#108492) 2023-08-27 23:19:31 -06:00
Erlend E. Aasland d0160c7c22
gh-64662: Add virtual table support to sqlite3.Connection.iterdump (#108340)
Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
2023-08-28 00:18:32 +02:00
John Micco fecb9faf0b
gh-108465: Use compiler basename when determining compiler flags (#108392)
Note:
GNU Autoconf discourages the use of 'basename', and recommends 'expr' instead.

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-08-27 21:07:09 +00:00
Erlend E. Aasland 38afa4af9b
gh-107801: Document io.TextIOWrapper.tell (#108265) 2023-08-27 20:35:27 +00:00
Ori Avtalion a429eafef2
gh-108542: Fix incorrect module name in NEWS entry for gh-105475 (#108543) 2023-08-27 21:50:59 +02:00
Raymond Hettinger 042aa88bcc
gh-108322: Optimize statistics.NormalDist.samples() (gh-108324) 2023-08-27 08:59:40 -05:00
Clément Robert 09343dba44
Clarify distinction between datetime module and class in deprecation messages (GH-108073) 2023-08-27 16:09:40 +03:00
Matthew James Kraai cd0a8aece9
Fix grammatical error in stringprep documentation (#108414)
Remove the word "them", which didn't make grammatical sense.

Co-authored-by: KRAAI, MATTHEW [VISUS] <mkraai@its.jnj.com>
2023-08-27 11:26:23 +00:00
R 7096a2be33
gh-105052:update timeit function's description (#105060)
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-08-27 03:22:27 -04:00
qqwqqw689 1ac64237e6
gh-107453: Document errno.{ECANCELED,EOWNERDEAD,ENOTRECOVERABLE,ENOTSUP} (#107486)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-27 05:19:49 +00:00
Dong-hee Na 6cb48f0495
gh-107265: Fix initialize/remove_tools for ENTER_EXECUTOR case (gh-108482) 2023-08-27 12:31:29 +09:00
Jelle Zijlstra 482fad7f01
gh-108295: Fix crashes with TypeVar weakrefs (#108517) 2023-08-26 17:13:33 -07:00
Serhiy Storchaka 2b15536fa9
gh-107913: Fix possible losses of OSError error codes (GH-107930)
Functions like PyErr_SetFromErrno() and SetFromWindowsErr() should be
called immediately after using the C API which sets errno or the Windows
error code.
2023-08-27 00:35:06 +03:00
denballakh e407cea193
gh-107406: Add better `struct.Struct` repr (#107407) 2023-08-26 15:24:16 +05:30
Victor Stinner 8ba4714611
gh-106320: Remove private AC converter functions (#108505)
Move these private functions to the internal C API
(pycore_abstract.h):

* _Py_convert_optional_to_ssize_t()
* _PyNumber_Index()

Argument Clinic now emits #include "pycore_abstract.h" when these
functions are used.

The parser of the c-analyzer tool now uses a list of files which use
the limited C API, rather than a list of files using the internal C
API.
2023-08-26 04:05:17 +02:00
Victor Stinner 6353c21b78
gh-106320: Remove private _PyLong_FileDescriptor_Converter() (#108503)
Move the private _PyLong converter functions to the internal C API

* _PyLong_FileDescriptor_Converter(): moved to pycore_fileutils.h
* _PyLong_Size_t_Converter(): moved to pycore_long.h

Argument Clinic now emits includes for pycore_fileutils.h and
pycore_long.h when these functions are used.
2023-08-26 03:18:09 +02:00
Victor Stinner 713afb8804
gh-106320: Remove private _PyLong converter functions (#108499)
Move these private functions to the internal C API (pycore_long.h):

* _PyLong_UnsignedInt_Converter()
* _PyLong_UnsignedLongLong_Converter()
* _PyLong_UnsignedLong_Converter()
* _PyLong_UnsignedShort_Converter()

Argument Clinic now emits #include "pycore_long.h" when these
functions are used.
2023-08-26 02:24:27 +02:00
Victor Stinner 86bc9e35c4
gh-108494: AC supports pos-only args in limited C API (#108498)
AC now checks for "#define Py_LIMITED_API" pattern to use the limited
C API.
2023-08-26 00:39:24 +02:00
Victor Stinner 73d33c1a30
gh-107603: Argument Clinic can emit includes (#108486)
* Add Clinic.add_include() method
* Add CConverter.include and CConverter.add_include()
* Printer.print_block() gets a second parameter: clinic.
* Remove duplicated declaration of "clinic" global variable.
2023-08-26 00:01:10 +02:00
Victor Stinner 1dd9510977
gh-108494: Argument Clinic partial supports of Limited C API (#108495)
Argument Clinic now has a partial support of the
Limited API:

* Add --limited option to clinic.c.
* Add '_testclinic_limited' extension which is built with
  the limited C API version 3.13.
* For now, hardcode in clinic.py that "_testclinic_limited.c" targets
  the limited C API.
2023-08-25 23:22:08 +02:00
Brandt Bucher 4eae1e5342
GH-106581: Fix instrumentation in tier 2 (GH-108493) 2023-08-25 19:12:59 +00:00
Irit Katriel 5f41376e93
gh-107901: add the HAS_EVAL_BREAK instruction flag (#108375) 2023-08-25 18:33:59 +00:00
Alex Waygood 5a25daa512
gh-104504: Cases generator: enable mypy's `possibly-undefined` error code (#108454) 2023-08-25 18:08:29 +01:00
Philipp A 6895ddf6cb
gh-102211: Document `re.{Pattern,Match}`’s existence (#102212)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-25 10:53:11 -06:00
Guido van Rossum 5347018409
gh-108311: Fix test_store_attr_with_hint by disabling optimizer in decorator (#108312)
See https://github.com/python/cpython/issues/108311#issuecomment-1693569380

---------

Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2023-08-25 16:40:27 +00:00
Dong-hee Na 66b4d9c9f0
gh-107265: Revert "Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR" (#108485)
This reverts commit d6ac5c7b10.

Reason: the assert we just added could be triggered (see issue).
2023-08-25 15:23:39 +00:00
Mariusz Felisiak 75903f29f6
gh-108364: Simplify quoting values and identifiers in sqlite3's iterdump() (#108472) 2023-08-25 12:31:52 +00:00
Mark Shannon bc2f9e6258
gh-107932: Fix merge conflict in test_dis (GH-108478)
Fix merge conflict in test_dis
2023-08-25 13:02:10 +01:00
Erlend E. Aasland cb1184280b
Docs: Resolve Sphinx warnings in dis.rst (#108476)
- Link to the code objects reference
- Suppress link to deliberately undocumented builtins.__build_class__
- Suppress links for example methods
2023-08-25 13:28:47 +02:00
Adam Turner 2b7bff0655
Datamodel: Add headings to the standard type hierarchy (#108146)
Dedent content according to the new layout.
2023-08-25 13:02:36 +02:00
Adam Turner 7f5b1a0661
Docs: Datamodel: Merge "Notes on using __slots__" with the parent section (#108400) 2023-08-25 12:27:36 +02:00
Serhiy Storchaka 4ae3edf300
gh-108418: Speed up bigmem compression tests in dry mode (GH-108419)
Only generate and compress small amount of random data in dry run.
2023-08-25 12:37:27 +03:00
Victor Stinner e59a95238b
gh-108444: Remove _PyLong_AsInt() function (#108461)
* Update Parser/asdl_c.py to regenerate Python/Python-ast.c.
* Remove _PyLong_AsInt() alias to PyLong_AsInt().
2023-08-25 11:13:59 +02:00
Corvin 24aa249a66
gh-107932: Fix dis module for bytecode that does not have an associated source line (GH-107988) 2023-08-25 09:31:26 +01:00
Peeyush Aggarwal 8d4052075e
gh-103384: Generalize the regex pattern `BaseConfigurator.INDEX_PATTERN` to allow spaces and non-alphanumeric characters in keys. (GH-103391)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-08-25 09:15:26 +01:00
Adam Turner 135098743a
GH-108202: Document ``calendar`` exceptions (#108398) 2023-08-24 23:56:54 -06:00
Guido van Rossum ddf66b54ed
gh-106581: Split CALL_BOUND_METHOD_EXACT_ARGS into uops (#108462)
Instead of using `GO_TO_INSTRUCTION(CALL_PY_EXACT_ARGS)` we just add the macro elements of the latter to the macro for the former. This requires lengthening the uops array in struct opcode_macro_expansion. (It also required changes to stacking.py that were merged already.)
2023-08-24 17:36:00 -07:00
Victor Stinner 546cab8444
gh-106320: Remove private _PyTraceback functions (#108453)
Move private functions to the internal C API (pycore_traceback.h):

* _Py_DisplaySourceLine()
* _PyTraceback_Add()
2023-08-24 23:35:47 +00:00
Dong-hee Na d6ac5c7b10
gh-107265: Ensure _PyCode_Quicken does not handle ENTER_EXECUTOR (gh-108460) 2023-08-24 23:03:26 +00:00
Victor Stinner b32d4cad15
gh-108444: Replace _PyLong_AsInt() with PyLong_AsInt() (#108459)
Change generated by the command:

sed -i -e 's!_PyLong_AsInt!PyLong_AsInt!g' \
    $(find -name "*.c" -o -name "*.h")
2023-08-25 01:01:30 +02:00
Victor Stinner 4e5a7284ee
gh-108444: Argument Clinic uses PyLong_AsInt() (#108458)
Argument Clinic now uses the new public PyLong_AsInt(), rather than
the old name _PyLong_AsInt().
2023-08-25 00:51:22 +02:00
Nikita Sobolev be800f4be7
Run `mypy` when `Tools/requirements-dev.txt` changes (#108457) 2023-08-24 22:05:23 +00:00
Victor Stinner be436e08b8
gh-108444: Add PyLong_AsInt() public function (#108445)
* Rename _PyLong_AsInt() to PyLong_AsInt().
* Add documentation.
* Add test.
* For now, keep _PyLong_AsInt() as an alias to PyLong_AsInt().
2023-08-24 23:55:30 +02:00
Filipe Laíns feb9a49c9c
GH-103247: bypass the import cache on the _require_loader helper 2023-08-24 21:05:03 +00:00
Samuel Thibault edb569e8e1
gh-108447: Detect platform triplets for x86_64 GNU/Hurd (#108045) 2023-08-24 22:37:20 +02:00
Victor Stinner a071ecb4d1
gh-106320: Remove private _PySys functions (#108452)
Move private functions to the internal C API (pycore_sysmodule.h):

* _PySys_GetAttr()
* _PySys_GetSizeOf()

No longer export most of these functions.

Fix also a typo in Include/cpython/optimizer.h: add a missing space.
2023-08-24 20:02:09 +00:00
Victor Stinner 26893016a7
gh-106320: Remove private _PyDict functions (#108449)
Move private functions to the internal C API (pycore_dict.h):

* _PyDictView_Intersect()
* _PyDictView_New()
* _PyDict_ContainsId()
* _PyDict_DelItemId()
* _PyDict_DelItem_KnownHash()
* _PyDict_GetItemIdWithError()
* _PyDict_GetItem_KnownHash()
* _PyDict_HasSplitTable()
* _PyDict_NewPresized()
* _PyDict_Next()
* _PyDict_Pop()
* _PyDict_SetItemId()
* _PyDict_SetItem_KnownHash()
* _PyDict_SizeOf()

No longer export most of these functions.

Move also the _PyDictViewObject structure to the internal C API.

Move dict_getitem_knownhash() function from _testcapi to the
_testinternalcapi extension. Update test_capi.test_dict for this
change.
2023-08-24 20:01:50 +00:00
Victor Stinner c3d580b238
gh-106320: Remove private _PyList functions (#108451)
Move private functions to the internal C API (pycore_list.h):

* _PyList_Extend()
* _PyList_DebugMallocStats()

No longer export these functions.
2023-08-24 19:44:34 +00:00
Guido van Rossum 88941d665f
gh-106581: Fix two bugs in the code generator's copy optimization (#108380)
I was comparing the last preceding poke with the *last* peek,
rather than the *first* peek.

Unfortunately this bug obscured another bug:
When the last preceding poke is UNUSED, the first peek disappears,
leaving the variable unassigned. This is how I fixed it:

- Rename CopyEffect to CopyItem.
- Change CopyItem to contain StackItems instead of StackEffects.
- Update those StackItems when adjusting the manager higher or lower.
- Assert that those StackItems' offsets are equivalent.
- Other clever things.

---------

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-08-24 19:10:51 +00:00
Victor Stinner c494fb333b
gh-106320: Remove private _PyEval function (#108433)
Move private _PyEval functions to the internal C API
(pycore_ceval.h):

* _PyEval_GetBuiltin()
* _PyEval_GetBuiltinId()
* _PyEval_GetSwitchInterval()
* _PyEval_MakePendingCalls()
* _PyEval_SetProfile()
* _PyEval_SetSwitchInterval()
* _PyEval_SetTrace()

No longer export most of these functions.
2023-08-24 20:25:22 +02:00