-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
[3.6] bpo-29581: Make __init_subclass__ work on ABCMeta type classes #1282
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
Conversation
…#527) Many metaclasses in the standard library don't play nice with __init_subclass__. This bug makes ABCMeta in particular with __init_subclass__, which is an 80/20 solution for me personally. AFAICT, a general solution to this problem requires updating all metaclasses in the standard library to make sure they pass **kwargs to type.__new__, whereas this PR only fixes ABCMeta. For context, see https://bugs.python.org/issue29581. * added a test combining ABCMeta and __init_subclass__ * Added NEWS item Note: I'm not sure I backported the NEWS changes correctly; I'm assuming that the cherry_picker tool merged everything corectly except for the explicit merge conflicts, but I'm not sure this is true. (cherry picked from commit bd583ef)
…ythonGH-527) Many metaclasses in the standard library don't play nice with __init_subclass__. This bug makes ABCMeta in particular with __init_subclass__, which is an 80/20 solution for me personally. AFAICT, a general solution to this problem requires updating all metaclasses in the standard library to make sure they pass **kwargs to type.__new__, whereas this PR only fixes ABCMeta. For context, see https://bugs.python.org/issue29581. * added a test combining ABCMeta and __init_subclass__ * Added NEWS item. (cherry picked from commit bd583ef)
Sorry with the confusion of how to use cherry_picker.py. I suppose you were following the instruction here, which mentions about merging with Once you have cherry_picker.py you'll only need to do Hope this helps a bit :) If you want, I can do the backport for you later today. |
Nvm, I changed the base branch to |
Bump. What do I need to do to cause this backport to happen? |
Sorry this fell off my radar. |
Conflict resolved. Thanks! |
Travis build failed.. 🤔 |
Misc/NEWS
Outdated
@@ -45,6 +45,9 @@ Core and Builtins | |||
Library | |||
------- | |||
|
|||
- bpo-29581: ABCMeta.__new__ now accepts **kwargs, allowing abstract base |
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.
Instead of
**kwargs
, can you try
``kwargs``
That might fix it for travis.
Thanks 🎉 |
I'm not entirely sure that I used the cherry_pick tool correctly, please make sure that I didn't muck anything up.
I'm also planning to backport PR #678, which depends on this backport (of PR #527). I assume that I shouldn't begin that backport until this one is accepted, but let me know if I can begin cherry-picking #678 now.