Skip to content

Commit d095976

Browse files
committed
Merge branch 'main' into exits-arent-escapes
2 parents 3dce740 + e7b55f5 commit d095976

35 files changed

+669
-301
lines changed

Doc/c-api/complex.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,36 @@ pointers. This is consistent throughout the API.
4343
Return the sum of two complex numbers, using the C :c:type:`Py_complex`
4444
representation.
4545
46+
.. deprecated:: 3.15
47+
This function is :term:`soft deprecated`.
48+
4649
4750
.. c:function:: Py_complex _Py_c_diff(Py_complex left, Py_complex right)
4851
4952
Return the difference between two complex numbers, using the C
5053
:c:type:`Py_complex` representation.
5154
55+
.. deprecated:: 3.15
56+
This function is :term:`soft deprecated`.
57+
5258
5359
.. c:function:: Py_complex _Py_c_neg(Py_complex num)
5460
5561
Return the negation of the complex number *num*, using the C
5662
:c:type:`Py_complex` representation.
5763
64+
.. deprecated:: 3.15
65+
This function is :term:`soft deprecated`.
66+
5867
5968
.. c:function:: Py_complex _Py_c_prod(Py_complex left, Py_complex right)
6069
6170
Return the product of two complex numbers, using the C :c:type:`Py_complex`
6271
representation.
6372
73+
.. deprecated:: 3.15
74+
This function is :term:`soft deprecated`.
75+
6476
6577
.. c:function:: Py_complex _Py_c_quot(Py_complex dividend, Py_complex divisor)
6678
@@ -70,6 +82,9 @@ pointers. This is consistent throughout the API.
7082
If *divisor* is null, this method returns zero and sets
7183
:c:data:`errno` to :c:macro:`!EDOM`.
7284
85+
.. deprecated:: 3.15
86+
This function is :term:`soft deprecated`.
87+
7388
7489
.. c:function:: Py_complex _Py_c_pow(Py_complex num, Py_complex exp)
7590
@@ -81,6 +96,19 @@ pointers. This is consistent throughout the API.
8196
8297
Set :c:data:`errno` to :c:macro:`!ERANGE` on overflows.
8398
99+
.. deprecated:: 3.15
100+
This function is :term:`soft deprecated`.
101+
102+
103+
.. c:function:: double _Py_c_abs(Py_complex num)
104+
105+
Return the absolute value of the complex number *num*.
106+
107+
Set :c:data:`errno` to :c:macro:`!ERANGE` on overflows.
108+
109+
.. deprecated:: 3.15
110+
This function is :term:`soft deprecated`.
111+
84112
85113
Complex Numbers as Python Objects
86114
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Doc/library/calendar.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,14 @@ The :mod:`calendar` module exports the following data attributes:
501501
>>> list(calendar.month_name)
502502
['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
503503

504+
.. caution::
505+
506+
In locales with alternative month names forms, the :data:`!month_name` sequence
507+
may not be suitable when a month name stands by itself and not as part of a date.
508+
For instance, in Greek and in many Slavic and Baltic languages, :data:`!month_name`
509+
will produce the month in genitive case. Use :data:`standalone_month_name` for a form
510+
suitable for standalone use.
511+
504512

505513
.. data:: month_abbr
506514

@@ -512,6 +520,31 @@ The :mod:`calendar` module exports the following data attributes:
512520
>>> list(calendar.month_abbr)
513521
['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
514522

523+
.. caution::
524+
525+
In locales with alternative month names forms, the :data:`!month_abbr` sequence
526+
may not be suitable when a month name stands by itself and not as part of a date.
527+
Use :data:`standalone_month_abbr` for a form suitable for standalone use.
528+
529+
530+
.. data:: standalone_month_name
531+
532+
A sequence that represents the months of the year in the current locale
533+
in the standalone form if the locale provides one. Else it is equivalent
534+
to :data:`month_name`.
535+
536+
.. versionadded:: next
537+
538+
539+
.. data:: standalone_month_abbr
540+
541+
A sequence that represents the abbreviated months of the year in the current
542+
locale in the standalone form if the locale provides one. Else it is
543+
equivalent to :data:`month_abbr`.
544+
545+
.. versionadded:: next
546+
547+
515548
.. data:: JANUARY
516549
FEBRUARY
517550
MARCH

Doc/whatsnew/3.15.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,11 @@ Deprecated C APIs
548548
signed integer type of the same size is now deprecated.
549549
(Contributed by Serhiy Storchaka in :gh:`132629`.)
550550

551+
* Functions :c:func:`_Py_c_sum`, :c:func:`_Py_c_diff`, :c:func:`_Py_c_neg`,
552+
:c:func:`_Py_c_prod`, :c:func:`_Py_c_quot`, :c:func:`_Py_c_pow` and
553+
:c:func:`_Py_c_abs` are :term:`soft deprecated`.
554+
(Contributed by Sergey B Kirpichev in :gh:`128813`.)
555+
551556
.. Add C API deprecations above alphabetically, not here at the end.
552557
553558
Removed C APIs

Include/cpython/complexobject.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ typedef struct {
77
double imag;
88
} Py_complex;
99

10-
// Operations on complex numbers.
10+
/* Operations on complex numbers (soft deprecated
11+
since Python 3.15). */
1112
PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);
1213
PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);
1314
PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);

Include/cpython/pystate.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ struct _ts {
198198

199199
PyObject *current_executor;
200200

201+
/* Internal to the JIT */
202+
struct _PyExitData *jit_exit;
203+
201204
uint64_t dict_global_version;
202205

203206
/* Used to store/retrieve `threading.local` keys/values for this thread */

Include/internal/pycore_interp_structs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,7 @@ struct _is {
943943
bool jit;
944944
struct _PyExecutorObject *executor_list_head;
945945
struct _PyExecutorObject *executor_deletion_list_head;
946+
struct _PyExecutorObject *cold_executor;
946947
int executor_deletion_list_remaining_capacity;
947948
size_t trace_run_counter;
948949
_rare_events rare_events;

Include/internal/pycore_optimizer.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ typedef struct {
6767
#endif
6868
} _PyUOpInstruction;
6969

70-
typedef struct {
70+
typedef struct _PyExitData {
7171
uint32_t target;
72+
uint16_t index;
7273
_Py_BackoffCounter temperature;
7374
struct _PyExecutorObject *executor;
7475
} _PyExitData;
@@ -354,6 +355,16 @@ PyAPI_FUNC(PyObject *) _Py_uop_symbols_test(PyObject *self, PyObject *ignored);
354355

355356
PyAPI_FUNC(int) _PyOptimizer_Optimize(_PyInterpreterFrame *frame, _Py_CODEUNIT *start, _PyExecutorObject **exec_ptr, int chain_depth);
356357

358+
static inline _PyExecutorObject *_PyExecutor_FromExit(_PyExitData *exit)
359+
{
360+
_PyExitData *exit0 = exit - exit->index;
361+
return (_PyExecutorObject *)(((char *)exit0) - offsetof(_PyExecutorObject, exits));
362+
}
363+
364+
extern _PyExecutorObject *_PyExecutor_GetColdExecutor(void);
365+
366+
PyAPI_FUNC(void) _PyExecutor_ClearExit(_PyExitData *exit);
367+
357368
static inline int is_terminator(const _PyUOpInstruction *uop)
358369
{
359370
int opcode = uop->opcode;
@@ -363,6 +374,8 @@ static inline int is_terminator(const _PyUOpInstruction *uop)
363374
);
364375
}
365376

377+
extern void _PyExecutor_Free(_PyExecutorObject *self);
378+
366379
PyAPI_FUNC(int) _PyDumpExecutors(FILE *out);
367380
#ifdef _Py_TIER2
368381
extern void _Py_ClearExecutorDeletionList(PyInterpreterState *interp);

0 commit comments

Comments
 (0)