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-28866: No type cache for types with specialized mro, invalidation is hard. #13157
bpo-28866: No type cache for types with specialized mro, invalidation is hard. #13157
Conversation
_Py_IDENTIFIER(mro); | ||
int unbound; | ||
PyObject *mro_meth = lookup_maybe_method( | ||
(PyObject *)type, &PyId_mro, &unbound); |
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.
mro_meth
needs to be checked for NULL before lookup_maybe_method
is called again.
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.
OK :-] is using a goto legit here? It'll avoid a bunch of if (clear == 0)
(see current impl).
LGTM |
@markshannon: Please replace |
Thanks @JulienPalard for the PR, and @markshannon for merging it |
GH-13589 is a backport of this pull request to the 3.7 branch. |
… is hard. (pythonGH-13157) * No type cache for types with specialized mro, invalidation is hard. * FIX: Don't disable method cache custom types that do not implement mro(). * fixing implem. * Avoid storing error flags, also decref. * news entry * Clear as soon as we're getting an error. * FIX: Reference leak. (cherry picked from commit 180dc1b) Co-authored-by: Julien Palard <julien@palard.fr>
…dation is hard. (GH-13157) (GH-13589) * No type cache for types with specialized mro, invalidation is hard. * FIX: Don't disable method cache custom types that do not implement mro(). * fixing implem. * Avoid storing error flags, also decref. * news entry * Clear as soon as we're getting an error. * FIX: Reference leak. (cherry picked from commit 180dc1b) Co-authored-by: Julien Palard <julien@palard.fr> https://bugs.python.org/issue28866
… is hard. (python#13157) * No type cache for types with specialized mro, invalidation is hard. * FIX: Don't disable method cache custom types that do not implement mro(). * fixing implem. * Avoid storing error flags, also decref. * news entry * Clear as soon as we're getting an error. * FIX: Reference leak.
This is an alternative implementation of #13117 based on @markshannon idea (https://bugs.python.org/issue28866#msg341581).
https://bugs.python.org/issue28866