blob: e36f824eeb3569310d0a19a640e4a7801d73e879 [file] [log] [blame]
Victor Stinner6eb99662018-11-26 17:09:16 +01001#ifndef Py_CPYTHON_OBJECT_H
2# error "this header file must not be included directly"
3#endif
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
Victor Stinnerf58bd7c2020-02-05 13:12:19 +01009PyAPI_FUNC(void) _Py_NewReference(PyObject *op);
10
11#ifdef Py_TRACE_REFS
12/* Py_TRACE_REFS is such major surgery that we call external routines. */
13PyAPI_FUNC(void) _Py_ForgetReference(PyObject *);
14#endif
15
16/* Update the Python traceback of an object. This function must be called
17 when a memory block is reused from a free list. */
18PyAPI_FUNC(int) _PyTraceMalloc_NewReference(PyObject *op);
19
20#ifdef Py_REF_DEBUG
21PyAPI_FUNC(Py_ssize_t) _Py_GetRefTotal(void);
22#endif
23
24
Victor Stinner6eb99662018-11-26 17:09:16 +010025/********************* String Literals ****************************************/
26/* This structure helps managing static strings. The basic usage goes like this:
27 Instead of doing
28
29 r = PyObject_CallMethod(o, "foo", "args", ...);
30
31 do
32
33 _Py_IDENTIFIER(foo);
34 ...
35 r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...);
36
37 PyId_foo is a static variable, either on block level or file level. On first
38 usage, the string "foo" is interned, and the structures are linked. On interpreter
39 shutdown, all strings are released (through _PyUnicode_ClearStaticStrings).
40
41 Alternatively, _Py_static_string allows choosing the variable name.
42 _PyUnicode_FromId returns a borrowed reference to the interned string.
43 _PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*.
44*/
45typedef struct _Py_Identifier {
46 struct _Py_Identifier *next;
47 const char* string;
48 PyObject *object;
49} _Py_Identifier;
50
51#define _Py_static_string_init(value) { .next = NULL, .string = value, .object = NULL }
52#define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value)
53#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname)
54
55/* buffer interface */
56typedef struct bufferinfo {
57 void *buf;
58 PyObject *obj; /* owned reference */
59 Py_ssize_t len;
60 Py_ssize_t itemsize; /* This is Py_ssize_t so it can be
61 pointed to by strides in simple case.*/
62 int readonly;
63 int ndim;
64 char *format;
65 Py_ssize_t *shape;
66 Py_ssize_t *strides;
67 Py_ssize_t *suboffsets;
68 void *internal;
69} Py_buffer;
70
71typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
72typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
73
Jeroen Demeyeraacc77f2019-05-29 20:31:52 +020074typedef PyObject *(*vectorcallfunc)(PyObject *callable, PyObject *const *args,
75 size_t nargsf, PyObject *kwnames);
76
Victor Stinner6eb99662018-11-26 17:09:16 +010077/* Maximum number of dimensions */
78#define PyBUF_MAX_NDIM 64
79
80/* Flags for getting buffers */
81#define PyBUF_SIMPLE 0
82#define PyBUF_WRITABLE 0x0001
83/* we used to include an E, backwards compatible alias */
84#define PyBUF_WRITEABLE PyBUF_WRITABLE
85#define PyBUF_FORMAT 0x0004
86#define PyBUF_ND 0x0008
87#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
88#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
89#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
90#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
91#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
92
93#define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE)
94#define PyBUF_CONTIG_RO (PyBUF_ND)
95
96#define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE)
97#define PyBUF_STRIDED_RO (PyBUF_STRIDES)
98
99#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT)
100#define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT)
101
102#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT)
103#define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT)
104
105
106#define PyBUF_READ 0x100
107#define PyBUF_WRITE 0x200
108/* End buffer interface */
109
110
111typedef struct {
112 /* Number implementations must check *both*
113 arguments for proper type and implement the necessary conversions
114 in the slot functions themselves. */
115
116 binaryfunc nb_add;
117 binaryfunc nb_subtract;
118 binaryfunc nb_multiply;
119 binaryfunc nb_remainder;
120 binaryfunc nb_divmod;
121 ternaryfunc nb_power;
122 unaryfunc nb_negative;
123 unaryfunc nb_positive;
124 unaryfunc nb_absolute;
125 inquiry nb_bool;
126 unaryfunc nb_invert;
127 binaryfunc nb_lshift;
128 binaryfunc nb_rshift;
129 binaryfunc nb_and;
130 binaryfunc nb_xor;
131 binaryfunc nb_or;
132 unaryfunc nb_int;
133 void *nb_reserved; /* the slot formerly known as nb_long */
134 unaryfunc nb_float;
135
136 binaryfunc nb_inplace_add;
137 binaryfunc nb_inplace_subtract;
138 binaryfunc nb_inplace_multiply;
139 binaryfunc nb_inplace_remainder;
140 ternaryfunc nb_inplace_power;
141 binaryfunc nb_inplace_lshift;
142 binaryfunc nb_inplace_rshift;
143 binaryfunc nb_inplace_and;
144 binaryfunc nb_inplace_xor;
145 binaryfunc nb_inplace_or;
146
147 binaryfunc nb_floor_divide;
148 binaryfunc nb_true_divide;
149 binaryfunc nb_inplace_floor_divide;
150 binaryfunc nb_inplace_true_divide;
151
152 unaryfunc nb_index;
153
154 binaryfunc nb_matrix_multiply;
155 binaryfunc nb_inplace_matrix_multiply;
156} PyNumberMethods;
157
158typedef struct {
159 lenfunc sq_length;
160 binaryfunc sq_concat;
161 ssizeargfunc sq_repeat;
162 ssizeargfunc sq_item;
163 void *was_sq_slice;
164 ssizeobjargproc sq_ass_item;
165 void *was_sq_ass_slice;
166 objobjproc sq_contains;
167
168 binaryfunc sq_inplace_concat;
169 ssizeargfunc sq_inplace_repeat;
170} PySequenceMethods;
171
172typedef struct {
173 lenfunc mp_length;
174 binaryfunc mp_subscript;
175 objobjargproc mp_ass_subscript;
176} PyMappingMethods;
177
178typedef struct {
179 unaryfunc am_await;
180 unaryfunc am_aiter;
181 unaryfunc am_anext;
182} PyAsyncMethods;
183
184typedef struct {
185 getbufferproc bf_getbuffer;
186 releasebufferproc bf_releasebuffer;
187} PyBufferProcs;
188
Jeroen Demeyeraacc77f2019-05-29 20:31:52 +0200189/* Allow printfunc in the tp_vectorcall_offset slot for
190 * backwards-compatibility */
191typedef Py_ssize_t printfunc;
Victor Stinner6eb99662018-11-26 17:09:16 +0100192
193typedef struct _typeobject {
194 PyObject_VAR_HEAD
195 const char *tp_name; /* For printing, in format "<module>.<name>" */
196 Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */
197
198 /* Methods to implement standard operations */
199
200 destructor tp_dealloc;
Jeroen Demeyeraacc77f2019-05-29 20:31:52 +0200201 Py_ssize_t tp_vectorcall_offset;
Victor Stinner6eb99662018-11-26 17:09:16 +0100202 getattrfunc tp_getattr;
203 setattrfunc tp_setattr;
204 PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)
205 or tp_reserved (Python 3) */
206 reprfunc tp_repr;
207
208 /* Method suites for standard classes */
209
210 PyNumberMethods *tp_as_number;
211 PySequenceMethods *tp_as_sequence;
212 PyMappingMethods *tp_as_mapping;
213
214 /* More standard operations (here for binary compatibility) */
215
216 hashfunc tp_hash;
217 ternaryfunc tp_call;
218 reprfunc tp_str;
219 getattrofunc tp_getattro;
220 setattrofunc tp_setattro;
221
222 /* Functions to access object as input/output buffer */
223 PyBufferProcs *tp_as_buffer;
224
225 /* Flags to define presence of optional/expanded features */
226 unsigned long tp_flags;
227
228 const char *tp_doc; /* Documentation string */
229
230 /* Assigned meaning in release 2.0 */
231 /* call function for all accessible objects */
232 traverseproc tp_traverse;
233
234 /* delete references to contained objects */
235 inquiry tp_clear;
236
237 /* Assigned meaning in release 2.1 */
238 /* rich comparisons */
239 richcmpfunc tp_richcompare;
240
241 /* weak reference enabler */
242 Py_ssize_t tp_weaklistoffset;
243
244 /* Iterators */
245 getiterfunc tp_iter;
246 iternextfunc tp_iternext;
247
248 /* Attribute descriptor and subclassing stuff */
249 struct PyMethodDef *tp_methods;
250 struct PyMemberDef *tp_members;
251 struct PyGetSetDef *tp_getset;
252 struct _typeobject *tp_base;
253 PyObject *tp_dict;
254 descrgetfunc tp_descr_get;
255 descrsetfunc tp_descr_set;
256 Py_ssize_t tp_dictoffset;
257 initproc tp_init;
258 allocfunc tp_alloc;
259 newfunc tp_new;
260 freefunc tp_free; /* Low-level free-memory routine */
261 inquiry tp_is_gc; /* For PyObject_IS_GC */
262 PyObject *tp_bases;
263 PyObject *tp_mro; /* method resolution order */
264 PyObject *tp_cache;
265 PyObject *tp_subclasses;
266 PyObject *tp_weaklist;
267 destructor tp_del;
268
269 /* Type attribute cache version tag. Added in version 2.6 */
270 unsigned int tp_version_tag;
271
272 destructor tp_finalize;
Jeroen Demeyeraacc77f2019-05-29 20:31:52 +0200273 vectorcallfunc tp_vectorcall;
Victor Stinner6eb99662018-11-26 17:09:16 +0100274} PyTypeObject;
275
276/* The *real* layout of a type object when allocated on the heap */
277typedef struct _heaptypeobject {
278 /* Note: there's a dependency on the order of these members
279 in slotptr() in typeobject.c . */
280 PyTypeObject ht_type;
281 PyAsyncMethods as_async;
282 PyNumberMethods as_number;
283 PyMappingMethods as_mapping;
284 PySequenceMethods as_sequence; /* as_sequence comes after as_mapping,
285 so that the mapping wins when both
286 the mapping and the sequence define
287 a given operator (e.g. __getitem__).
288 see add_operators() in typeobject.c . */
289 PyBufferProcs as_buffer;
290 PyObject *ht_name, *ht_slots, *ht_qualname;
291 struct _dictkeysobject *ht_cached_keys;
292 /* here are optional user slots, followed by the members. */
293} PyHeapTypeObject;
294
295/* access macro to the members which are floating "behind" the object */
296#define PyHeapType_GET_MEMBERS(etype) \
297 ((PyMemberDef *)(((char *)etype) + Py_TYPE(etype)->tp_basicsize))
298
299PyAPI_FUNC(const char *) _PyType_Name(PyTypeObject *);
300PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);
301PyAPI_FUNC(PyObject *) _PyType_LookupId(PyTypeObject *, _Py_Identifier *);
302PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, _Py_Identifier *);
303PyAPI_FUNC(PyTypeObject *) _PyType_CalculateMetaclass(PyTypeObject *, PyObject *);
304PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *, const char *);
305PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, const char *);
306
307struct _Py_Identifier;
308PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);
309PyAPI_FUNC(void) _Py_BreakPoint(void);
310PyAPI_FUNC(void) _PyObject_Dump(PyObject *);
311PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);
312
313PyAPI_FUNC(int) _PyObject_IsAbstract(PyObject *);
314PyAPI_FUNC(PyObject *) _PyObject_GetAttrId(PyObject *, struct _Py_Identifier *);
315PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, struct _Py_Identifier *, PyObject *);
316PyAPI_FUNC(int) _PyObject_HasAttrId(PyObject *, struct _Py_Identifier *);
317/* Replacements of PyObject_GetAttr() and _PyObject_GetAttrId() which
318 don't raise AttributeError.
319
320 Return 1 and set *result != NULL if an attribute is found.
321 Return 0 and set *result == NULL if an attribute is not found;
322 an AttributeError is silenced.
323 Return -1 and set *result == NULL if an error other than AttributeError
324 is raised.
325*/
326PyAPI_FUNC(int) _PyObject_LookupAttr(PyObject *, PyObject *, PyObject **);
327PyAPI_FUNC(int) _PyObject_LookupAttrId(PyObject *, struct _Py_Identifier *, PyObject **);
Jeroen Demeyerb2f94732019-06-14 12:37:15 +0200328
329PyAPI_FUNC(int) _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
330
Victor Stinner6eb99662018-11-26 17:09:16 +0100331PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
332PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *);
333PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);
334PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *);
335
336/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes
337 dict as the last parameter. */
338PyAPI_FUNC(PyObject *)
339_PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *, int);
340PyAPI_FUNC(int)
341_PyObject_GenericSetAttrWithDict(PyObject *, PyObject *,
342 PyObject *, PyObject *);
343
Victor Stinner6eb99662018-11-26 17:09:16 +0100344#define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0)
345
Jeroen Demeyerbf17d412019-11-05 16:48:04 +0100346PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
Victor Stinner6eb99662018-11-26 17:09:16 +0100347
348/* Safely decref `op` and set `op` to `op2`.
349 *
350 * As in case of Py_CLEAR "the obvious" code can be deadly:
351 *
352 * Py_DECREF(op);
353 * op = op2;
354 *
355 * The safe way is:
356 *
357 * Py_SETREF(op, op2);
358 *
359 * That arranges to set `op` to `op2` _before_ decref'ing, so that any code
360 * triggered as a side-effect of `op` getting torn down no longer believes
361 * `op` points to a valid object.
362 *
363 * Py_XSETREF is a variant of Py_SETREF that uses Py_XDECREF instead of
364 * Py_DECREF.
365 */
366
367#define Py_SETREF(op, op2) \
368 do { \
369 PyObject *_py_tmp = _PyObject_CAST(op); \
370 (op) = (op2); \
371 Py_DECREF(_py_tmp); \
372 } while (0)
373
374#define Py_XSETREF(op, op2) \
375 do { \
376 PyObject *_py_tmp = _PyObject_CAST(op); \
377 (op) = (op2); \
378 Py_XDECREF(_py_tmp); \
379 } while (0)
380
381
382PyAPI_DATA(PyTypeObject) _PyNone_Type;
383PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type;
384
385/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.
386 * Defined in object.c.
387 */
388PyAPI_DATA(int) _Py_SwappedOp[];
389
390/* This is the old private API, invoked by the macros before 3.2.4.
391 Kept for binary compatibility of extensions using the stable ABI. */
392PyAPI_FUNC(void) _PyTrash_deposit_object(PyObject*);
393PyAPI_FUNC(void) _PyTrash_destroy_chain(void);
394
395PyAPI_FUNC(void)
396_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
397 size_t sizeof_block);
398PyAPI_FUNC(void)
399_PyObject_DebugTypeStats(FILE *out);
400
401/* Define a pair of assertion macros:
402 _PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT().
403
404 These work like the regular C assert(), in that they will abort the
405 process with a message on stderr if the given condition fails to hold,
406 but compile away to nothing if NDEBUG is defined.
407
408 However, before aborting, Python will also try to call _PyObject_Dump() on
409 the given object. This may be of use when investigating bugs in which a
410 particular object is corrupt (e.g. buggy a tp_visit method in an extension
411 module breaking the garbage collector), to help locate the broken objects.
412
413 The WITH_MSG variant allows you to supply an additional message that Python
414 will attempt to print to stderr, after the object dump. */
415#ifdef NDEBUG
416 /* No debugging: compile away the assertions: */
417# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \
418 ((void)0)
419#else
420 /* With debugging: generate checks: */
421# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \
422 ((expr) \
423 ? (void)(0) \
424 : _PyObject_AssertFailed((obj), Py_STRINGIFY(expr), \
425 (msg), (filename), (lineno), (func)))
426#endif
427
428#define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \
429 _PyObject_ASSERT_FROM(obj, expr, msg, __FILE__, __LINE__, __func__)
430#define _PyObject_ASSERT(obj, expr) \
431 _PyObject_ASSERT_WITH_MSG(obj, expr, NULL)
432
433#define _PyObject_ASSERT_FAILED_MSG(obj, msg) \
434 _PyObject_AssertFailed((obj), NULL, (msg), __FILE__, __LINE__, __func__)
435
436/* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined,
437 to avoid causing compiler/linker errors when building extensions without
438 NDEBUG against a Python built with NDEBUG defined.
439
440 msg, expr and function can be NULL. */
Victor Stinner2a4903f2020-01-30 13:09:11 +0100441PyAPI_FUNC(void) _Py_NO_RETURN _PyObject_AssertFailed(
Victor Stinner6eb99662018-11-26 17:09:16 +0100442 PyObject *obj,
443 const char *expr,
444 const char *msg,
445 const char *file,
446 int line,
447 const char *function);
448
Victor Stinner0fc91ee2019-04-12 21:51:34 +0200449/* Check if an object is consistent. For example, ensure that the reference
450 counter is greater than or equal to 1, and ensure that ob_type is not NULL.
451
452 Call _PyObject_AssertFailed() if the object is inconsistent.
453
454 If check_content is zero, only check header fields: reduce the overhead.
455
456 The function always return 1. The return value is just here to be able to
457 write:
458
459 assert(_PyObject_CheckConsistency(obj, 1)); */
460PyAPI_FUNC(int) _PyObject_CheckConsistency(
461 PyObject *op,
462 int check_content);
463
Victor Stinner0fa4f432020-02-05 12:23:27 +0100464
465/* Trashcan mechanism, thanks to Christian Tismer.
466
467When deallocating a container object, it's possible to trigger an unbounded
468chain of deallocations, as each Py_DECREF in turn drops the refcount on "the
469next" object in the chain to 0. This can easily lead to stack overflows,
470especially in threads (which typically have less stack space to work with).
471
472A container object can avoid this by bracketing the body of its tp_dealloc
473function with a pair of macros:
474
475static void
476mytype_dealloc(mytype *p)
477{
478 ... declarations go here ...
479
480 PyObject_GC_UnTrack(p); // must untrack first
481 Py_TRASHCAN_BEGIN(p, mytype_dealloc)
482 ... The body of the deallocator goes here, including all calls ...
483 ... to Py_DECREF on contained objects. ...
484 Py_TRASHCAN_END // there should be no code after this
485}
486
487CAUTION: Never return from the middle of the body! If the body needs to
488"get out early", put a label immediately before the Py_TRASHCAN_END
489call, and goto it. Else the call-depth counter (see below) will stay
490above 0 forever, and the trashcan will never get emptied.
491
492How it works: The BEGIN macro increments a call-depth counter. So long
493as this counter is small, the body of the deallocator is run directly without
494further ado. But if the counter gets large, it instead adds p to a list of
495objects to be deallocated later, skips the body of the deallocator, and
496resumes execution after the END macro. The tp_dealloc routine then returns
497without deallocating anything (and so unbounded call-stack depth is avoided).
498
499When the call stack finishes unwinding again, code generated by the END macro
500notices this, and calls another routine to deallocate all the objects that
501may have been added to the list of deferred deallocations. In effect, a
502chain of N deallocations is broken into (N-1)/(PyTrash_UNWIND_LEVEL-1) pieces,
503with the call stack never exceeding a depth of PyTrash_UNWIND_LEVEL.
504
505Since the tp_dealloc of a subclass typically calls the tp_dealloc of the base
506class, we need to ensure that the trashcan is only triggered on the tp_dealloc
507of the actual class being deallocated. Otherwise we might end up with a
508partially-deallocated object. To check this, the tp_dealloc function must be
509passed as second argument to Py_TRASHCAN_BEGIN().
510*/
511
512/* The new thread-safe private API, invoked by the macros below. */
513PyAPI_FUNC(void) _PyTrash_thread_deposit_object(PyObject*);
514PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void);
515
516#define PyTrash_UNWIND_LEVEL 50
517
518#define Py_TRASHCAN_BEGIN_CONDITION(op, cond) \
519 do { \
520 PyThreadState *_tstate = NULL; \
521 /* If "cond" is false, then _tstate remains NULL and the deallocator \
522 * is run normally without involving the trashcan */ \
523 if (cond) { \
524 _tstate = PyThreadState_GET(); \
525 if (_tstate->trash_delete_nesting >= PyTrash_UNWIND_LEVEL) { \
526 /* Store the object (to be deallocated later) and jump past \
527 * Py_TRASHCAN_END, skipping the body of the deallocator */ \
528 _PyTrash_thread_deposit_object(_PyObject_CAST(op)); \
529 break; \
530 } \
531 ++_tstate->trash_delete_nesting; \
532 }
533 /* The body of the deallocator is here. */
534#define Py_TRASHCAN_END \
535 if (_tstate) { \
536 --_tstate->trash_delete_nesting; \
537 if (_tstate->trash_delete_later && _tstate->trash_delete_nesting <= 0) \
538 _PyTrash_thread_destroy_chain(); \
539 } \
540 } while (0);
541
542#define Py_TRASHCAN_BEGIN(op, dealloc) Py_TRASHCAN_BEGIN_CONDITION(op, \
543 Py_TYPE(op)->tp_dealloc == (destructor)(dealloc))
544
545/* For backwards compatibility, these macros enable the trashcan
546 * unconditionally */
547#define Py_TRASHCAN_SAFE_BEGIN(op) Py_TRASHCAN_BEGIN_CONDITION(op, 1)
548#define Py_TRASHCAN_SAFE_END(op) Py_TRASHCAN_END
549
Victor Stinner6eb99662018-11-26 17:09:16 +0100550#ifdef __cplusplus
551}
552#endif