-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Make __bases__
mutable
#5325
Make __bases__
mutable
#5325
Conversation
The test failures don't seem related to my changes. @youknowone any insight? |
The failing test is about threading, it might be flaky. re-triggered failed jobs. |
Leaving a comment will be enough for now.
How is this done in CPython? Does it maintain weakrefs to subclasses?
We don't have this feature yet. To do this, we have to implement slot copy first, which will remove most of |
Yes, the subclass list is a |
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.
👍
Assigning
__bases__
allows you to alter the class inheritance tree at any point. The updatedtyping.py
uses this feature when constructingNamedTuples
, for reasons unknown to me.I had to make
PyType.bases
andPyType.mro
mutable behind aPyRwLock
in order to enable this feature.Assigning
__bases__
has several features I wasn't sure how to implement. I left TODOs for these:__subclass__
lists it used to belong to