Skip to content

Commit cfaa21a

Browse files
committed
Remove _PyCode_ConstantKey() function
Move the function to the internal C API and no longer export it.
1 parent 5a77f02 commit cfaa21a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Include/cpython/code.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,15 +282,6 @@ typedef struct _line_offsets {
282282
*/
283283
PyAPI_FUNC(int) _PyCode_CheckLineNumber(int lasti, PyCodeAddressRange *bounds);
284284

285-
/* Create a comparable key used to compare constants taking in account the
286-
* object type. It is used to make sure types are not coerced (e.g., float and
287-
* complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms
288-
*
289-
* Return (type(obj), obj, ...): a tuple with variable size (at least 2 items)
290-
* depending on the type and the value. The type is the first item to not
291-
* compare bytes and str which can raise a BytesWarning exception. */
292-
PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj);
293-
294285
PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
295286
PyObject *names, PyObject *lnotab);
296287

Include/internal/pycore_code.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,15 @@ PyAPI_FUNC(int) _PyCode_VerifyStateless(
663663
PyAPI_FUNC(int) _PyCode_CheckPureFunction(PyCodeObject *, const char **);
664664
PyAPI_FUNC(int) _PyCode_ReturnsOnlyNone(PyCodeObject *);
665665

666+
/* Create a comparable key used to compare constants taking in account the
667+
* object type. It is used to make sure types are not coerced (e.g., float and
668+
* complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms
669+
*
670+
* Return (type(obj), obj, ...): a tuple with variable size (at least 2 items)
671+
* depending on the type and the value. The type is the first item to not
672+
* compare bytes and str which can raise a BytesWarning exception. */
673+
extern PyObject* _PyCode_ConstantKey(PyObject *obj);
674+
666675

667676
#ifdef __cplusplus
668677
}

0 commit comments

Comments
 (0)