Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd62fb1

Browse files
authored
Merge branch 'main' into replace_iso_calculation
2 parents a7687be + b51da99 commit cd62fb1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1462
-725
lines changed

.github/workflows/require-pr-label.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
label:
9-
name: DO-NOT-MERGE
9+
name: DO-NOT-MERGE / unresolved review
1010
runs-on: ubuntu-latest
1111
timeout-minutes: 10
1212

@@ -15,4 +15,4 @@ jobs:
1515
with:
1616
mode: exactly
1717
count: 0
18-
labels: "DO-NOT-MERGE"
18+
labels: "DO-NOT-MERGE, awaiting changes, awaiting change review"

Doc/library/contextlib.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,15 @@ Functions and classes provided:
304304

305305
This context manager is :ref:`reentrant <reentrant-cms>`.
306306

307+
If the code within the :keyword:`!with` block raises an
308+
:exc:`ExceptionGroup`, suppressed exceptions are removed from the
309+
group. If any exceptions in the group are not suppressed, a group containing them is re-raised.
310+
307311
.. versionadded:: 3.4
308312

313+
.. versionchanged:: 3.12
314+
``suppress`` now supports suppressing exceptions raised as
315+
part of an :exc:`ExceptionGroup`.
309316

310317
.. function:: redirect_stdout(new_target)
311318

Doc/library/dataclasses.rst

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

Doc/library/dis.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,24 @@ iterations of the loop.
10361036
pushed to the stack before the attribute or unbound method respectively.
10371037

10381038

1039+
.. opcode:: LOAD_SUPER_ATTR (namei)
1040+
1041+
This opcode implements :func:`super` (e.g. ``super().method()`` and
1042+
``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that
1043+
``namei`` is shifted left by 2 bits instead of 1, and instead of expecting a
1044+
single receiver on the stack, it expects three objects (from top of stack
1045+
down): ``self`` (the first argument to the current method), ``cls`` (the
1046+
class within which the current method was defined), and the global ``super``.
1047+
1048+
The low bit of ``namei`` signals to attempt a method load, as with
1049+
:opcode:`LOAD_ATTR`.
1050+
1051+
The second-low bit of ``namei``, if set, means that this was a two-argument
1052+
call to :func:`super` (unset means zero-argument).
1053+
1054+
.. versionadded:: 3.12
1055+
1056+
10391057
.. opcode:: COMPARE_OP (opname)
10401058

10411059
Performs a Boolean operation. The operation name can be found in

Doc/library/socketserver.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,16 @@ server is the address family.
140140
ForkingUDPServer
141141
ThreadingTCPServer
142142
ThreadingUDPServer
143+
ForkingUnixStreamServer
144+
ForkingUnixDatagramServer
145+
ThreadingUnixStreamServer
146+
ThreadingUnixDatagramServer
143147

144148
These classes are pre-defined using the mix-in classes.
145149

150+
.. versionadded:: 3.12
151+
The ``ForkingUnixStreamServer`` and ``ForkingUnixDatagramServer`` classes
152+
were added.
146153

147154
To implement a service, you must derive a class from :class:`BaseRequestHandler`
148155
and redefine its :meth:`~BaseRequestHandler.handle` method.

Doc/tools/.nitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ Doc/library/csv.rst
111111
Doc/library/ctypes.rst
112112
Doc/library/curses.ascii.rst
113113
Doc/library/curses.rst
114-
Doc/library/dataclasses.rst
115114
Doc/library/datetime.rst
116115
Doc/library/dbm.rst
117116
Doc/library/decimal.rst
@@ -178,7 +177,6 @@ Doc/library/os.rst
178177
Doc/library/ossaudiodev.rst
179178
Doc/library/pickle.rst
180179
Doc/library/pickletools.rst
181-
Doc/library/pkgutil.rst
182180
Doc/library/platform.rst
183181
Doc/library/plistlib.rst
184182
Doc/library/poplib.rst

Include/cpython/initconfig.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ PyAPI_FUNC(PyStatus) PyConfig_SetWideStringList(PyConfig *config,
245245
/* --- PyInterpreterConfig ------------------------------------ */
246246

247247
typedef struct {
248+
// XXX "allow_object_sharing"? "own_objects"?
249+
int use_main_obmalloc;
248250
int allow_fork;
249251
int allow_exec;
250252
int allow_threads;
@@ -254,6 +256,7 @@ typedef struct {
254256

255257
#define _PyInterpreterConfig_INIT \
256258
{ \
259+
.use_main_obmalloc = 0, \
257260
.allow_fork = 0, \
258261
.allow_exec = 0, \
259262
.allow_threads = 1, \
@@ -263,6 +266,7 @@ typedef struct {
263266

264267
#define _PyInterpreterConfig_LEGACY_INIT \
265268
{ \
269+
.use_main_obmalloc = 1, \
266270
.allow_fork = 1, \
267271
.allow_exec = 1, \
268272
.allow_threads = 1, \

Include/cpython/pystate.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ is available in a given context. For example, forking the process
1111
might not be allowed in the current interpreter (i.e. os.fork() would fail).
1212
*/
1313

14+
/* Set if the interpreter share obmalloc runtime state
15+
with the main interpreter. */
16+
#define Py_RTFLAGS_USE_MAIN_OBMALLOC (1UL << 5)
17+
1418
/* Set if import should check a module for subinterpreter support. */
1519
#define Py_RTFLAGS_MULTI_INTERP_EXTENSIONS (1UL << 8)
1620

Include/internal/pycore_interp.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ extern "C" {
2323
#include "pycore_function.h" // FUNC_MAX_WATCHERS
2424
#include "pycore_genobject.h" // struct _Py_async_gen_state
2525
#include "pycore_gc.h" // struct _gc_runtime_state
26+
#include "pycore_global_objects.h" // struct _Py_interp_static_objects
2627
#include "pycore_import.h" // struct _import_state
2728
#include "pycore_instruments.h" // PY_MONITORING_EVENTS
2829
#include "pycore_list.h" // struct _Py_list_state
29-
#include "pycore_global_objects.h" // struct _Py_interp_static_objects
3030
#include "pycore_object_state.h" // struct _py_object_state
31+
#include "pycore_obmalloc.h" // struct obmalloc_state
3132
#include "pycore_tuple.h" // struct _Py_tuple_state
3233
#include "pycore_typeobject.h" // struct type_cache
3334
#include "pycore_unicodeobject.h" // struct _Py_unicode_state
@@ -82,6 +83,8 @@ struct _is {
8283
int _initialized;
8384
int finalizing;
8485

86+
struct _obmalloc_state obmalloc;
87+
8588
struct _ceval_state ceval;
8689
struct _gc_runtime_state gc;
8790

Include/internal/pycore_obmalloc.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,12 @@ struct _obmalloc_usage {
657657
#endif /* WITH_PYMALLOC_RADIX_TREE */
658658

659659

660-
struct _obmalloc_state {
660+
struct _obmalloc_global_state {
661661
int dump_debug_stats;
662+
Py_ssize_t interpreter_leaks;
663+
};
664+
665+
struct _obmalloc_state {
662666
struct _obmalloc_pools pools;
663667
struct _obmalloc_mgmt mgmt;
664668
struct _obmalloc_usage usage;
@@ -675,7 +679,11 @@ void _PyObject_VirtualFree(void *, size_t size);
675679

676680

677681
/* This function returns the number of allocated memory blocks, regardless of size */
678-
PyAPI_FUNC(Py_ssize_t) _Py_GetAllocatedBlocks(void);
682+
extern Py_ssize_t _Py_GetGlobalAllocatedBlocks(void);
683+
#define _Py_GetAllocatedBlocks() \
684+
_Py_GetGlobalAllocatedBlocks()
685+
extern Py_ssize_t _PyInterpreterState_GetAllocatedBlocks(PyInterpreterState *);
686+
extern void _PyInterpreterState_FinalizeAllocatedBlocks(PyInterpreterState *);
679687

680688

681689
#ifdef WITH_PYMALLOC

0 commit comments

Comments
 (0)