File tree Expand file tree Collapse file tree 14 files changed +74
-26
lines changed Expand file tree Collapse file tree 14 files changed +74
-26
lines changed Original file line number Diff line number Diff line change
1
+ Pending removal in Python 3.16
2
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3
+
4
+ * Deprecated private functions (:gh: `128863 `):
5
+
6
+ * :c:func: `!_PyBytes_Join `: use :c:func: `PyBytes_Join `.
7
+ * :c:func: `!_PyDict_GetItemStringWithError `: use :c:func: `PyDict_GetItemStringRef `.
8
+ * :c:func: `!_PyThreadState_UncheckedGet `: use :c:func: `PyThreadState_GetUnchecked `.
9
+ * :c:func: `!_PyUnicode_AsString `: use :c:func: `PyUnicode_AsUTF8 `.
10
+ * :c:func: `!_Py_HashPointer `: use :c:func: `Py_HashPointer `.
11
+ * :c:func: `!_Py_fopen_obj `: use :c:func: `Py_fopen `.
Original file line number Diff line number Diff line change @@ -1356,12 +1356,27 @@ Deprecated
1356
1356
1357
1357
.. include :: ../deprecations/c-api-pending-removal-in-3.15.rst
1358
1358
1359
+ .. include :: ../deprecations/c-api-pending-removal-in-3.16.rst
1360
+
1359
1361
.. include :: ../deprecations/c-api-pending-removal-in-future.rst
1360
1362
1361
1363
* The ``PyMonitoring_FireBranchEvent `` function is deprecated and should
1362
1364
be replaced with calls to :c:func: `PyMonitoring_FireBranchLeftEvent `
1363
1365
and :c:func: `PyMonitoring_FireBranchRightEvent `.
1364
1366
1367
+ * The following private functions are deprecated and planned for removal in
1368
+ Python 3.16:
1369
+
1370
+ * :c:func: `!_PyBytes_Join `: use :c:func: `PyBytes_Join `.
1371
+ * :c:func: `!_PyDict_GetItemStringWithError `: use :c:func: `PyDict_GetItemStringRef `.
1372
+ * :c:func: `!_PyThreadState_UncheckedGet `: use :c:func: `PyThreadState_GetUnchecked `.
1373
+ * :c:func: `!_PyUnicode_AsString `: use :c:func: `PyUnicode_AsUTF8 `.
1374
+ * :c:func: `!_Py_HashPointer `: use :c:func: `Py_HashPointer `.
1375
+ * :c:func: `!_Py_fopen_obj `: use :c:func: `Py_fopen `.
1376
+
1377
+ (Contributed by Victor Stinner in :gh: `128863 `.)
1378
+
1379
+
1365
1380
Removed
1366
1381
-------
1367
1382
Original file line number Diff line number Diff line change @@ -34,5 +34,9 @@ static inline Py_ssize_t PyBytes_GET_SIZE(PyObject *op) {
34
34
35
35
PyAPI_FUNC (PyObject * ) PyBytes_Join (PyObject * sep , PyObject * iterable );
36
36
37
- // Alias kept for backward compatibility
38
- #define _PyBytes_Join PyBytes_Join
37
+ // Deprecated alias kept for backward compatibility
38
+ Py_DEPRECATED (3.14 ) static inline PyObject *
39
+ _PyBytes_Join (PyObject * sep , PyObject * iterable )
40
+ {
41
+ return PyBytes_Join (sep , iterable );
42
+ }
Original file line number Diff line number Diff line change @@ -6,9 +6,11 @@ PyAPI_FUNC(FILE*) Py_fopen(
6
6
PyObject * path ,
7
7
const char * mode );
8
8
9
- // Deprecated alias to Py_fopen() kept for backward compatibility
10
- Py_DEPRECATED (3.14 ) PyAPI_FUNC (FILE * ) _Py_fopen_obj (
11
- PyObject * path ,
12
- const char * mode );
9
+ // Deprecated alias kept for backward compatibility
10
+ Py_DEPRECATED (3.14 ) static inline FILE *
11
+ _Py_fopen_obj (PyObject * path , const char * mode )
12
+ {
13
+ return Py_fopen (path , mode );
14
+ }
13
15
14
16
PyAPI_FUNC (int ) Py_fclose (FILE * file );
Original file line number Diff line number Diff line change 29
29
/* Helpers for hash functions */
30
30
PyAPI_FUNC (Py_hash_t ) _Py_HashDouble (PyObject * , double );
31
31
32
- // Kept for backward compatibility
33
- #define _Py_HashPointer Py_HashPointer
34
-
35
32
36
33
/* hash function definition */
37
34
typedef struct {
@@ -44,6 +41,14 @@ typedef struct {
44
41
PyAPI_FUNC (PyHash_FuncDef * ) PyHash_GetFuncDef (void );
45
42
46
43
PyAPI_FUNC (Py_hash_t ) Py_HashPointer (const void * ptr );
44
+
45
+ // Deprecated alias kept for backward compatibility
46
+ Py_DEPRECATED (3.14 ) static inline Py_hash_t
47
+ _Py_HashPointer (const void * ptr )
48
+ {
49
+ return Py_HashPointer (ptr );
50
+ }
51
+
47
52
PyAPI_FUNC (Py_hash_t ) PyObject_GenericHash (PyObject * );
48
53
49
54
PyAPI_FUNC (Py_hash_t ) Py_HashBuffer (const void * ptr , Py_ssize_t len );
Original file line number Diff line number Diff line change @@ -239,8 +239,12 @@ struct _ts {
239
239
* if it is NULL. */
240
240
PyAPI_FUNC (PyThreadState * ) PyThreadState_GetUnchecked (void );
241
241
242
- // Alias kept for backward compatibility
243
- #define _PyThreadState_UncheckedGet PyThreadState_GetUnchecked
242
+ // Deprecated alias kept for backward compatibility
243
+ Py_DEPRECATED (3.14 ) static inline PyThreadState *
244
+ _PyThreadState_UncheckedGet (void )
245
+ {
246
+ return PyThreadState_GetUnchecked ();
247
+ }
244
248
245
249
246
250
// Disable tracing and profiling.
Original file line number Diff line number Diff line change @@ -630,8 +630,12 @@ _PyUnicodeWriter_Dealloc(_PyUnicodeWriter *writer);
630
630
631
631
PyAPI_FUNC (const char * ) PyUnicode_AsUTF8 (PyObject * unicode );
632
632
633
- // Alias kept for backward compatibility
634
- #define _PyUnicode_AsString PyUnicode_AsUTF8
633
+ // Deprecated alias kept for backward compatibility
634
+ Py_DEPRECATED (3.14 ) static inline const char *
635
+ _PyUnicode_AsString (PyObject * unicode )
636
+ {
637
+ return PyUnicode_AsUTF8 (unicode );
638
+ }
635
639
636
640
637
641
/* === Characters Type APIs =============================================== */
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ class C(A):
187
187
188
188
189
189
def test_open (testfn ):
190
- # SSLContext.load_dh_params uses _Py_fopen_obj rather than normal open()
190
+ # SSLContext.load_dh_params uses Py_fopen() rather than normal open()
191
191
try :
192
192
import ssl
193
193
Original file line number Diff line number Diff line change
1
+ The following private functions are deprecated and planned for removal in
2
+ Python 3.16:
3
+
4
+ * :c:func: `!_PyBytes_Join `: use :c:func: `PyBytes_Join `.
5
+ * :c:func: `!_PyDict_GetItemStringWithError `: use :c:func: `PyDict_GetItemStringRef `.
6
+ * :c:func: `!_PyThreadState_UncheckedGet `: use :c:func: `PyThreadState_GetUnchecked `.
7
+ * :c:func: `!_PyUnicode_AsString `: use :c:func: `PyUnicode_AsUTF8 `.
8
+ * :c:func: `!_Py_HashPointer `: use :c:func: `Py_HashPointer `.
9
+ * :c:func: `!_Py_fopen_obj `: use :c:func: `Py_fopen `.
10
+
11
+ Patch by Victor Stinner.
Original file line number Diff line number Diff line change @@ -1349,7 +1349,7 @@ wrapper_hash(PyObject *self)
1349
1349
wrapperobject * wp = (wrapperobject * )self ;
1350
1350
Py_hash_t x , y ;
1351
1351
x = PyObject_GenericHash (wp -> self );
1352
- y = _Py_HashPointer (wp -> descr );
1352
+ y = Py_HashPointer (wp -> descr );
1353
1353
x = x ^ y ;
1354
1354
if (x == -1 )
1355
1355
x = -2 ;
You can’t perform that action at this time.
0 commit comments