mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-46131: add fastpath for PyFloat_Check() (#30200)
This commit is contained in:
parent
aeb9ef4c72
commit
2ef06d4125
7 changed files with 23 additions and 0 deletions
|
@ -1959,6 +1959,7 @@ PyTypeObject PyFloat_Type = {
|
|||
0, /* tp_setattro */
|
||||
0, /* tp_as_buffer */
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |
|
||||
Py_TPFLAGS_FLOAT_SUBCLASS |
|
||||
_Py_TPFLAGS_MATCH_SELF, /* tp_flags */
|
||||
float_new__doc__, /* tp_doc */
|
||||
0, /* tp_traverse */
|
||||
|
|
|
@ -5783,6 +5783,9 @@ inherit_special(PyTypeObject *type, PyTypeObject *base)
|
|||
else if (PyType_IsSubtype(base, &PyDict_Type)) {
|
||||
type->tp_flags |= Py_TPFLAGS_DICT_SUBCLASS;
|
||||
}
|
||||
else if (PyType_IsSubtype(base, &PyFloat_Type)) {
|
||||
type->tp_flags |= Py_TPFLAGS_FLOAT_SUBCLASS;
|
||||
}
|
||||
if (PyType_HasFeature(base, _Py_TPFLAGS_MATCH_SELF)) {
|
||||
type->tp_flags |= _Py_TPFLAGS_MATCH_SELF;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue