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-28866: No type cache for types with specialized mro, invalidation is hard. #13157

Merged
merged 7 commits into from May 26, 2019

Conversation

JulienPalard
Copy link
Member

@JulienPalard JulienPalard commented May 7, 2019

Objects/typeobject.c Outdated Show resolved Hide resolved
Objects/typeobject.c Outdated Show resolved Hide resolved
_Py_IDENTIFIER(mro);
int unbound;
PyObject *mro_meth = lookup_maybe_method(
(PyObject *)type, &PyId_mro, &unbound);
Copy link
Member

@markshannon markshannon May 8, 2019

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.

Copy link
Member Author

@JulienPalard JulienPalard May 8, 2019

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).

@markshannon markshannon self-assigned this May 26, 2019
@markshannon
Copy link
Member

markshannon commented May 26, 2019

LGTM

@markshannon markshannon merged commit 180dc1b into python:master May 26, 2019
@bedevere-bot
Copy link

bedevere-bot commented May 26, 2019

@markshannon: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

miss-islington commented May 26, 2019

Thanks @JulienPalard for the PR, and @markshannon for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒🤖

@bedevere-bot
Copy link

bedevere-bot commented May 26, 2019

GH-13589 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 26, 2019
… 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>
miss-islington added a commit that referenced this pull request May 26, 2019
…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
@JulienPalard JulienPalard deleted the issue28866-alternative branch Jun 16, 2019
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants