Skip to content
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

bpo-44654: Do not export the union type related symbols #27223

Merged
merged 1 commit into from
Jul 18, 2021
Merged
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
8 changes: 4 additions & 4 deletions Include/internal/pycore_unionobject.h
Original file line number Diff line number Diff line change
@@ -8,13 +8,13 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define"
#endif

PyAPI_DATA(PyTypeObject) _PyUnion_Type;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the extern keywords here are optional right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is required for variable declarations and optional for function declarations. But other function declarations in headers have extern.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks. This LGTM. But you might have trouble backporting to 3.10 due to the ABI check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the ABI check does not complain when we stop exporting some symbols. It only complains if we add some new exported symbols.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the ABI check does not complain when we stop exporting some symbols. It only complains if we add some new exported symbols.

Fixing this in #27229. The check is backwards

extern PyTypeObject _PyUnion_Type;
#define _PyUnion_Check(op) Py_IS_TYPE(op, &_PyUnion_Type)
PyAPI_FUNC(PyObject *) _Py_union_type_or(PyObject *, PyObject *);
extern PyObject *_Py_union_type_or(PyObject *, PyObject *);

#define _PyGenericAlias_Check(op) PyObject_TypeCheck(op, &Py_GenericAliasType)
PyAPI_FUNC(PyObject *) _Py_subs_parameters(PyObject *, PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _Py_make_parameters(PyObject *);
extern PyObject *_Py_subs_parameters(PyObject *, PyObject *, PyObject *, PyObject *);
extern PyObject *_Py_make_parameters(PyObject *);

#ifdef __cplusplus
}