-
Notifications
You must be signed in to change notification settings - Fork 286
Some work on the NumPy test #783
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
Changes from all commits
6c4a0a1
b42cb29
c0bbdfb
b1b8d67
da72a44
477c209
30c004f
d837de3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3247,7 +3247,6 @@ extern "C" int PyType_Ready(PyTypeObject* cls) noexcept { | |
| Py_TPFLAGS_DICT_SUBCLASS | Py_TPFLAGS_BASE_EXC_SUBCLASS | Py_TPFLAGS_TYPE_SUBCLASS; | ||
RELEASE_ASSERT((cls->tp_flags & ~ALLOWABLE_FLAGS) == 0, ""); | ||
|
||
RELEASE_ASSERT(cls->tp_free == NULL || cls->tp_free == PyObject_Del || cls->tp_free == PyObject_GC_Del, ""); | ||
RELEASE_ASSERT(cls->tp_is_gc == NULL, ""); | ||
RELEASE_ASSERT(cls->tp_mro == NULL, ""); | ||
RELEASE_ASSERT(cls->tp_cache == NULL, ""); | ||
|
@@ -3278,6 +3277,19 @@ extern "C" int PyType_Ready(PyTypeObject* cls) noexcept { | |
|
||
assert(cls->tp_name); | ||
|
||
// Inherit some special protocols. Normally methods are automatically inherited, | ||
// when a Python class is declared, but that may not be the case with C extensions. | ||
if (base != NULL) { | ||
if (cls->tp_as_number == NULL) | ||
cls->tp_as_number = base->tp_as_number; | ||
if (cls->tp_as_sequence == NULL) | ||
cls->tp_as_sequence = base->tp_as_sequence; | ||
if (cls->tp_as_mapping == NULL) | ||
cls->tp_as_mapping = base->tp_as_mapping; | ||
if (cls->tp_as_buffer == NULL) | ||
cls->tp_as_buffer = base->tp_as_buffer; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm this is a bit odd to me -- why do we have to do this when cpython doesn't? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is in PyType_Ready, typeobject.cpp:4123 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah ok, right (not sure why I didn't see that). |
||
|
||
if (cls->tp_call) { | ||
cls->tpp_call.capi_val = tppProxyToTpCall<CAPI>; | ||
cls->tpp_call.cxx_val = tppProxyToTpCall<CXX>; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a quick comment here saying that this is a pyston change and what it's for?