8000 gh-107211: No longer export internal variables by vstinner · Pull Request #107218 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
8000

gh-107211: No longer export internal variables #107218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Include/internal/pycore_import.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,21 @@ struct _module_alias {
const char *orig; /* ASCII encoded string */
};

PyAPI_DATA(const struct _frozen *) _PyImport_FrozenBootstrap;
PyAPI_DATA(const struct _frozen *) _PyImport_FrozenStdlib;
PyAPI_DATA(const struct _frozen *) _PyImport_FrozenTest;
// Export for test_ctypes
PyAPI_DATA(const struct _frozen*) _PyImport_FrozenBootstrap;
// Export for test_ctypes
PyAPI_DATA(const struct _frozen*) _PyImport_FrozenStdlib;
// Export for test_ctypes
PyAPI_DATA(const struct _frozen*) _PyImport_FrozenTest;

extern const struct _module_alias * _PyImport_FrozenAliases;

extern int _PyImport_CheckSubinterpIncompatibleExtensionAllowed(
const char *name);


// Export for '_testinternalcapi' shared extension
PyAPI_DATA(int) _PyImport_ClearExtension(PyObject *name, PyObject *filename);
PyAPI_FUNC(int) _PyImport_ClearExtension(PyObject *name, PyObject *filename);

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions Include/internal/pycore_long.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ extern PyObject *_PyLong_Add(PyLongObject *left, PyLongObject *right);
extern PyObject *_PyLong_Multiply(PyLongObject *left, PyLongObject *right);
extern PyObject *_PyLong_Subtract(PyLongObject *left, PyLongObject *right);

/* Used by Python/mystrtoul.c, _PyBytes_FromHex(),
_PyBytes_DecodeEscape(), etc. */
// Used by _PyBytes_FromHex(), _PyBytes_DecodeEscape(), Python/mystrtoul.c.
// Export for 'binascii' shared extension.
PyAPI_DATA(unsigned char) _PyLong_DigitValue[256];

/* Format the object based on the format_spec, as defined in PEP 3101
Expand Down
9 changes: 6 additions & 3 deletions Include/ 8000 internal/pycore_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern void _PyDebugAllocatorStats(FILE *out, const char *block_name,
extern void _PyObject_DebugTypeStats(FILE *out);

// Export for shared _testinternalcapi extension
PyAPI_DATA(int) _PyObject_IsFreed(PyObject *);
PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);

/* We need to maintain an internal copy of Py{Var}Object_HEAD_INIT to avoid
designated initializer conflicts in C++20. If we use the deinition in
Expand Down Expand Up @@ -468,11 +468,14 @@ extern PyObject* _PyCFunctionWithKeywords_TrampolineCall(
(meth)((self), (args), (kw))
#endif // __EMSCRIPTEN__ && PY_CALL_TRAMPOLINE

// _pickle shared extension uses _PyNone_Type and _PyNotImplemented_Type
// Export for '_pickle' shared extension
PyAPI_DATA(PyTypeObject) _PyNone_Type;
// Export for '_pickle' shared extension
PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type;

/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE. Defined in Objects/object.c. */
// Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.
// Defined in Objects/object.c.
// Export for the stable ABI.
PyAPI_DATA(int) _Py_SwappedOp[];

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_pyhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ typedef union {
} expat;
} _Py_HashSecret_t;

// _elementtree shared extension uses _Py_HashSecret.expat
// Export for '_elementtree' shared extension
PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret;

#ifdef Py_DEBUG
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ _Py_ThreadCanHandleSignals(PyInterpreterState *interp)
#if defined(HAVE_THREAD_LOCAL) && !defined(Py_BUILD_CORE_MODULE)
extern _Py_thread_local PyThreadState *_Py_tss_tstate;
#endif
PyAPI_DATA(PyThreadState *) _PyThreadState_GetCurrent(void);
PyAPI_FUNC(PyThreadState *) _PyThreadState_GetCurrent(void);

/* Get the current Python thread state.

Expand Down
17 changes: 8 additions & 9 deletions Include/internal/pycore_typeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,17 @@ _PyType_IsReady(PyTypeObject *type)
return _PyType_GetDict(type) != NULL;
}

PyObject *
_Py_type_getattro_impl(PyTypeObject *type, PyObject *name, int *suppress_missing_attribute);
PyObject *
_Py_type_getattro(PyTypeObject *type, PyObject *name);
extern PyObject* _Py_type_getattro_impl(PyTypeObject *type, PyObject *name,
int *suppress_missing_attribute);
extern PyObject* _Py_type_getattro(PyTypeObject *type, PyObject *name);

PyObject *_Py_slot_tp_getattro(PyObject *self, PyObject *name);
PyObject *_Py_slot_tp_getattr_hook(PyObject *self, PyObject *name);
extern PyObject* _Py_slot_tp_getattro(PyObject *self, PyObject *name);
extern PyObject* _Py_slot_tp_getattr_hook(PyObject *self, PyObject *name);

PyAPI_DATA(PyTypeObject) _PyBufferWrapper_Type;
extern PyTypeObject _PyBufferWrapper_Type;

PyObject *
_PySuper_Lookup(PyTypeObject *su_type, PyObject *su_obj, PyObject *name, int *meth_found);
extern PyObject* _PySuper_Lookup(PyTypeObject *su_type, PyObject *su_obj,
PyObject *name, int *meth_found);

#ifdef __cplusplus
}
Expand Down
0