Skip to content

Conversation

@JulienPalard
Copy link
Member

@JulienPalard JulienPalard commented May 7, 2019

_Py_IDENTIFIER(mro);
int unbound;
PyObject *mro_meth = lookup_maybe_method(
(PyObject *)type, &PyId_mro, &unbound);
Copy link
Member

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

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

LGTM

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

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

@miss-islington
Copy link
Contributor

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

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 <[email protected]>
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 <[email protected]>


https://bugs.python.org/issue28866
@JulienPalard JulienPalard deleted the issue28866-alternative branch June 16, 2019 14:05
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.

6 participants