Pablo Galindo Salgado
da8f87b7ea
gh-107015: Remove async_hacks from the tokenizer ( #107018 )
2023-07-26 16:34:15 +01:00
Irit Katriel
b0202a4e5d
gh-106149: Simplify stack depth calculation. Replace asserts by exceptions. ( #107255 )
2023-07-26 13:32:47 +01:00
Alex Waygood
14d074e1fb
gh-104683: Argument Clinic: Make most arguments to `Class` and `Function` required ( #107289 )
2023-07-26 11:54:03 +01:00
Alex Waygood
c362678dd2
gh-104050: Argument clinic: improve typing around `parse_arg()` methods ( #107288 )
2023-07-26 11:51:24 +01:00
Christopher Chavez
d96ca41688
gh-103735: Tkinter: remove handling for uninteresting "procbody" Tcl value type (GH-103736)
2023-07-26 12:11:50 +03:00
Erlend E. Aasland
579100f6d7
gh-106368: Increase Argument Clinic CLI test coverage ( #107277 )
2023-07-26 08:34:14 +02:00
Alex Waygood
33838fedf7
gh-104050: Argument clinic: annotate `post_parsing()` and `cleanup()` ( #107225 )
2023-07-25 23:33:03 +01:00
Gregory P. Smith
70dc009469
gh-106939: document ShareableList nul-strip quirk. ( #107266 )
...
* gh-106939: document ShareableList nul-strip quirk.
* Mention the `int` size constraint.
2023-07-25 14:09:25 -07:00
Alex Waygood
ee9010784c
gh-104050: Argument clinic: more misc typing improvements ( #107264 )
2023-07-25 22:08:52 +01:00
Nikita Sobolev
7c89f11892
gh-106185: Deduplicate `CPythonTracebackErrorCaretTests` in `test_traceback` (GH-106187)
2023-07-25 23:37:47 +03:00
Guido van Rossum
233b878288
gh-107082: Fix instruction size computation for ENTER_EXECUTOR ( #107256 )
...
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-07-25 20:01:02 +00:00
Serhiy Storchaka
698b015135
gh-107226: PyModule_AddObjectRef() should only be in the limited API 3.10 (GH-107227)
2023-07-25 22:01:45 +03:00
Christopher Chavez
b5ae7c4984
gh-106350: Tkinter: do not ignore return value of `mp_init()` (GH-106351)
2023-07-25 21:52:07 +03:00
Serhiy Storchaka
2b1a81e2cf
gh-106004: PyDict_GetItemRef() should only be in the limited API 3.13 (GH-107229)
2023-07-25 21:48:07 +03:00
Victor Stinner
6a43cce32b
gh-107249: Implement Py_UNUSED() for MSVC ( #107250 )
...
Fix warnings C4100 in Py_UNUSED() when Python is built with "cl /W4".
Example with this function included by Python.h:
static inline unsigned int
PyUnicode_IS_READY(PyObject* Py_UNUSED(op))
{ return 1; }
Without this change, building a C program with "cl /W4" which just
includes Python.h emits the warning:
Include\cpython/unicodeobject.h(199):
warning C4100: '_unused_op': unreferenced formal parameter
This change fix this warning.
2023-07-25 19:28:16 +02:00
shailshouryya
fabcbe9c12
gh-106739: Add `rtype_cache` to `warnings.warn` message when leaked objects found ( #106740 )
...
Adding the `rtype_cache` to the `warnings.warn` message improves the
previous, somewhat vague message from
```
/Users/username/cpython/Lib/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown
```
to
```
/Users/username/cpython/Lib/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown: {'/mp-yor5cvj8', '/mp-10jx8eqr', '/mp-eobsx9tt', '/mp-0lml23vl', '/mp-9dgtsa_m', '/mp-frntyv4s'}
```
---------
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-07-25 17:27:36 +00:00
Victor Stinner
188000ae4b
Remove unused internal _PyImport_GetModuleId() function ( #107235 )
2023-07-25 17:02:12 +00:00
Victor Stinner
1c8fe9bdb6
gh-105059: Fix MSCV compiler warning on PyObject union ( #107239 )
...
Use pragma to ignore the MSCV compiler warning on the PyObject
nameless union.
2023-07-25 16:45:38 +02:00
Victor Stinner
1a3faba9f1
gh-106869: Use new PyMemberDef constant names ( #106871 )
...
* Remove '#include "structmember.h"'.
* If needed, add <stddef.h> to get offsetof() function.
* Update Parser/asdl_c.py to regenerate Python/Python-ast.c.
* Replace:
* T_SHORT => Py_T_SHORT
* T_INT => Py_T_INT
* T_LONG => Py_T_LONG
* T_FLOAT => Py_T_FLOAT
* T_DOUBLE => Py_T_DOUBLE
* T_STRING => Py_T_STRING
* T_OBJECT => _Py_T_OBJECT
* T_CHAR => Py_T_CHAR
* T_BYTE => Py_T_BYTE
* T_UBYTE => Py_T_UBYTE
* T_USHORT => Py_T_USHORT
* T_UINT => Py_T_UINT
* T_ULONG => Py_T_ULONG
* T_STRING_INPLACE => Py_T_STRING_INPLACE
* T_BOOL => Py_T_BOOL
* T_OBJECT_EX => Py_T_OBJECT_EX
* T_LONGLONG => Py_T_LONGLONG
* T_ULONGLONG => Py_T_ULONGLONG
* T_PYSSIZET => Py_T_PYSSIZET
* T_NONE => _Py_T_NONE
* READONLY => Py_READONLY
* PY_AUDIT_READ => Py_AUDIT_READ
* READ_RESTRICTED => Py_AUDIT_READ
* PY_WRITE_RESTRICTED => _Py_WRITE_RESTRICTED
* RESTRICTED => (READ_RESTRICTED | _Py_WRITE_RESTRICTED)
2023-07-25 15:28:30 +02:00
Victor Stinner
ed08238327
gh-107237: Fix test_udp_reconnection() of test_logging ( #107238 )
...
test_logging: Fix test_udp_reconnection() by increasing the timeout
from 100 ms to 5 minutes (LONG_TIMEOUT).
Replace also blocking wait() with wait(LONG_TIMEOUT) in
test_output() to prevent the test to hang.
2023-07-25 13:13:59 +00:00
Victor Stinner
6261585d63
gh-105059: Use GCC/clang extension for PyObject union ( #107232 )
...
Anonymous union is new in C11. To prevent compiler warning
when using -pedantic compiler option, use Clang and GCC
extension on C99 and older.
2023-07-25 12:27:48 +00:00
Daniele Procida
2425346fee
gh-106996: Add a how-to section to the turtle documentation ( #107153 )
...
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-07-25 15:03:57 +03:00
Serhiy Storchaka
329e4a1a3f
gh-86493: Modernize modules initialization code (GH-106858)
...
Use PyModule_Add() or PyModule_AddObjectRef() instead of soft deprecated
PyModule_AddObject().
2023-07-25 14:34:49 +03:00
Paul Moore
f443b54a2f
gh-106774: Update bundled pip version to 23.2.1 ( #106775 )
...
* Update bundled pip version to 23.2.1
2023-07-25 10:59:25 +01:00
Alex Waygood
d9e34db993
gh-104050: Argument clinic: more misc typing coverage improvements ( #107210 )
2023-07-25 08:49:07 +00:00
Alex Waygood
dbfe73837d
gh-104050: Argument clinic: improve typing around adding C converters ( #107209 )
2023-07-25 09:18:19 +01:00
Victor Stinner
3b309319cc
gh-107211: No longer export internal variables ( #107218 )
...
No longer export these 5 internal C API variables:
* _PyBufferWrapper_Type
* _PyImport_FrozenBootstrap
* _PyImport_FrozenStdlib
* _PyImport_FrozenTest
* _Py_SwappedOp
Fix the definition of these internal functions, replace PyAPI_DATA()
with PyAPI_FUNC():
* _PyImport_ClearExtension()
* _PyObject_IsFreed()
* _PyThreadState_GetCurrent()
2023-07-25 03:48:04 +00:00
Victor Stinner
c5b13d6f80
gh-107211: No longer export internal functions (4) ( #107217 )
...
No longer export these 2 internal C API functions:
* _PyEval_SignalAsyncExc()
* _PyEval_SignalReceived()
Add also comments explaining why some internal functions have to be
exported, and update existing comments.
2023-07-25 03:16:28 +00:00
Victor Stinner
0d0520af83
gh-107211: No longer export internal functions (3) ( #107215 )
...
No longer export these 14 internal C API functions:
* _PySys_Audit()
* _PySys_SetAttr()
* _PyTraceBack_FromFrame()
* _PyTraceBack_Print_Indented()
* _PyUnicode_FormatAdvancedWriter()
* _PyUnicode_ScanIdentifier()
* _PyWarnings_Init()
* _Py_DumpASCII()
* _Py_DumpDecimal()
* _Py_DumpHexadecimal()
* _Py_DumpTraceback()
* _Py_DumpTracebackThreads()
* _Py_WriteIndent()
* _Py_WriteIndentedMargin()
2023-07-25 02:25:45 +00:00
Victor Stinner
5a61692c6c
gh-107211: No longer export internal functions (2) ( #107214 )
...
No longer export these 43 internal C API functions:
* _PyDict_CheckConsistency()
* _PyErr_ChainStackItem()
* _PyErr_CheckSignals()
* _PyErr_CheckSignalsTstate()
* _PyErr_Clear()
* _PyErr_ExceptionMatches()
* _PyErr_Fetch()
* _PyErr_Format()
* _PyErr_FormatFromCauseTstate()
* _PyErr_GetExcInfo()
* _PyErr_GetHandledException()
* _PyErr_GetTopmostException()
* _PyErr_NoMemory()
* _PyErr_NormalizeException()
* _PyErr_Restore()
* _PyErr_SetHandledException()
* _PyErr_SetNone()
* _PyErr_SetObject()
* _PyErr_SetString()
* _PyErr_StackItemToExcInfoTuple()
* _PyExc_CreateExceptionGroup()
* _PyExc_PrepReraiseStar()
* _PyException_AddNote()
* _PyInterpreterState_Enable()
* _PyLong_FormatAdvancedWriter()
* _PyLong_FormatBytesWriter()
* _PyLong_FormatWriter()
* _PyMem_GetAllocatorName()
* _PyMem_SetDefaultAllocator()
* _PyMem_SetupAllocators()
* _PyOS_InterruptOccurred()
* _PyRuntimeState_Fini()
* _PyRuntimeState_Init()
* _PyRuntime_Finalize()
* _PyRuntime_Initialize()
* _PyThreadState_Bind()
* _PyThreadState_DeleteExcept()
* _PyThreadState_New()
* _PyThreadState_Swap()
* _PyType_CheckConsistency()
* _PyUnicodeTranslateError_Create()
* _Py_DumpExtensionModules()
* _Py_FatalErrorFormat()
2023-07-25 03:49:28 +02:00
Victor Stinner
11306a91bd
gh-107211: No longer export internal functions (1) ( #107213 )
...
No longer export these 49 internal C API functions:
* _PyArgv_AsWstrList()
* _PyCode_New()
* _PyCode_Validate()
* _PyFloat_DebugMallocStats()
* _PyFloat_FormatAdvancedWriter()
* _PyImport_CheckSubinterpIncompatibleExtensionAllowed()
* _PyImport_ClearExtension()
* _PyImport_GetModuleId()
* _PyImport_SetModuleString()
* _PyInterpreterState_IDDecref()
* _PyInterpreterState_IDIncref()
* _PyInterpreterState_IDInitref()
* _PyInterpreterState_LookUpID()
* _PyWideStringList_AsList()
* _PyWideStringList_CheckConsistency()
* _PyWideStringList_Clear()
* _PyWideStringList_Copy()
* _PyWideStringList_Extend()
* _Py_ClearArgcArgv()
* _Py_DecodeUTF8Ex()
* _Py_DecodeUTF8_surrogateescape()
* _Py_EncodeLocaleRaw()
* _Py_EncodeUTF8Ex()
* _Py_GetEnv()
* _Py_GetForceASCII()
* _Py_GetLocaleEncoding()
* _Py_GetLocaleEncodingObject()
* _Py_GetLocaleconvNumeric()
* _Py_ResetForceASCII()
* _Py_device_encoding()
* _Py_dg_dtoa()
* _Py_dg_freedtoa()
* _Py_dg_strtod()
* _Py_get_blocking()
* _Py_get_env_flag()
* _Py_get_inheritable()
* _Py_get_osfhandle_noraise()
* _Py_get_xoption()
* _Py_open()
* _Py_open_osfhandle()
* _Py_open_osfhandle_noraise()
* _Py_read()
* _Py_set_blocking()
* _Py_str_to_int()
* _Py_wfopen()
* _Py_wgetcwd()
* _Py_wreadlink()
* _Py_wrealpath()
* _Py_write()
2023-07-25 03:44:11 +02:00
Victor Stinner
2e0744955f
gh-107211: Rename PySymtable_Lookup() to _PySymtable_Lookup() ( #107212 )
...
Rename the internal PySymtable_Lookup() function to
_PySymtable_Lookup() and no longer export it.
2023-07-25 00:54:09 +00:00
Alex Waygood
4bbf071635
gh-104050: Argument Clinic: Annotate `CRenderData.__init__` ( #107207 )
...
Argument Clinic: Annotate `CRenderData.__init__`
2023-07-24 21:38:50 +00:00
Alex Waygood
d93fe5afe2
gh-104050: Argument clinic: misc improvements to type annotation coverage ( #107206 )
2023-07-24 21:23:58 +00:00
Irit Katriel
7608fa8fd5
gh-106149: move _PyCfg_BasicblockLastInstr and make it local to flowgraph.c ( #107180 )
2023-07-24 22:08:59 +01:00
Alex Waygood
ac2d85a174
gh-104050: Argument clinic: annotate `format_docstring()` ( #107200 )
2023-07-24 20:29:50 +00:00
Carl Meyer
e5d5522612
gh-106917: fix super classmethod calls to non-classmethods ( #106977 )
2023-07-24 13:14:56 -07:00
Tian Gao
b383703491
gh-106727: Add `__module__` check for `inspect.getsource(cls)` ( #106968 )
2023-07-24 13:12:45 -07:00
Victor Stinner
8ebc9fc321
gh-102304: Rename _Py_IncRefTotal_DO_NOT_USE_THIS() ( #107193 )
...
* Rename _Py_IncRefTotal_DO_NOT_USE_THIS() to _Py_INCREF_IncRefTotal()
* Rename _Py_DecRefTotal_DO_NOT_USE_THIS() to _Py_DECREF_DecRefTotal()
* Remove temporary _Py_INC_REFTOTAL() and _Py_DEC_REFTOTAL() macros
2023-07-24 19:47:50 +00:00
Victor Stinner
e717b47ed8
gh-98608: Move PyInterpreterConfig to pylifecycle.h ( #107191 )
...
Move PyInterpreterConfig structure and associated macros from
initconfig.h to pylifecycle.h: it's not related to the Python
Initialization Configuration.
2023-07-24 19:42:04 +00:00
Alex Waygood
db17529f80
gh-104050: Argument Clinic: annotate `main()` ( #107192 )
2023-07-24 19:32:38 +00:00
Victor Stinner
837fa5c0cd
GH-96803: Move PyUnstable_InterpreterFrame_GetCode() to Python.h ( #107188 )
...
Declare the following 3 PyUnstable functions in
Include/cpython/pyframe.h rather than Include/cpython/frameobject.h,
so they are now provided by the standard "#include <Python.h>".
2023-07-24 21:20:44 +02:00
Erlend E. Aasland
83a2837b32
gh-106368: Increase Argument Clinic CLI test coverage ( #107156 )
...
Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-07-24 20:49:16 +02:00
Victor Stinner
307186704d
gh-106320: Remove private _PyMem API ( #107187 )
...
Move private _PyMem functions to the internal C API (pycore_pymem.h):
* _PyMem_GetCurrentAllocatorName()
* _PyMem_RawStrdup()
* _PyMem_RawWcsdup()
* _PyMem_Strdup()
No longer export these functions.
Move pymem_getallocatorsname() function from _testcapi to _testinternalcapi,
since the API moved to the internal C API.
2023-07-24 18:48:06 +00:00
Victor Stinner
d27eb1e406
gh-106320: Remove private _PyUnicode C API ( #107185 )
...
Move private _PyUnicode functions to the internal C API
(pycore_unicodeobject.h):
* _PyUnicode_IsCaseIgnorable()
* _PyUnicode_IsCased()
* _PyUnicode_IsXidContinue()
* _PyUnicode_IsXidStart()
* _PyUnicode_ToFoldedFull()
* _PyUnicode_ToLowerFull()
* _PyUnicode_ToTitleFull()
* _PyUnicode_ToUpperFull()
No longer export these functions.
2023-07-24 18:26:29 +00:00
Guido van Rossum
032f480909
Thoroughly refactor the cases generator ( #107151 )
...
This mostly extracts a whole bunch of stuff out of generate_cases.py into separate files, but there are a few other things going on here.
- analysis.py: `Analyzer` etc.
- instructions.py: `Instruction` etc.
- flags.py: `InstructionFlags`, `variable_used`, `variable_used_unspecialized`
- formatting.py: `Formatter` etc.
- Rename parser.py to parsing.py, to avoid conflict with stdlib parser.py
- Blackify most things
- Fix most mypy errors
- Remove output filenames from Generator state, add them to `write_instructions()` etc.
- Fix unit tests
2023-07-24 09:38:23 -07:00
Erlend E. Aasland
ff5f94b72c
Docs: Add missing markup to Argument Clinic docs ( #106876 )
...
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-24 15:22:18 +00:00
Victor Stinner
7516953275
gh-107162: Document errcode.h usage in its comment ( #107177 )
...
Public and documented PyRun_InteractiveOneFlags() C API uses it.
2023-07-24 14:14:58 +00:00
Victor Stinner
fd66baf34a
gh-106320: Remove private _PyDict C API ( #107145 )
...
Move private _PyDict functions to the internal C API (pycore_dict.h):
* _PyDict_Contains_KnownHash()
* _PyDict_DebugMallocStats()
* _PyDict_DelItemIf()
* _PyDict_GetItemWithError()
* _PyDict_HasOnlyStringKeys()
* _PyDict_MaybeUntrack()
* _PyDict_MergeEx()
No longer export these functions.
2023-07-24 14:02:03 +00:00
da-woods
0a9b339363
Fix PyVectorcall_Function doc versionadded ( #107140 )
...
The documentation implies that PyVectorcall_Function() was available in Python 3.8.
This is half-true - it was available under a different name. I think it's clearer to set
the "version added" to 3.9.
2023-07-24 14:54:38 +02:00