diff options
author | Matti Picus <matti.picus@gmail.com> | 2021-12-19 20:24:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-19 20:24:30 (GMT) |
commit | 2ef06d412531d1163dbc72877c88aedf3ed82a25 (patch) | |
tree | 9a8a1f60d82447795da0345c00e561c15448cd1b /Objects/typeobject.c | |
parent | aeb9ef4c7287fe367b6e9adcf1c5f994d5bc1a09 (diff) | |
download | cpython-2ef06d412531d1163dbc72877c88aedf3ed82a25.zip cpython-2ef06d412531d1163dbc72877c88aedf3ed82a25.tar.gz cpython-2ef06d412531d1163dbc72877c88aedf3ed82a25.tar.bz2 |
bpo-46131: add fastpath for PyFloat_Check() (#30200)
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r-- | Objects/typeobject.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index af35180..8bd9280 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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; } |