Skip to content

bpo-29581: Make ABCMeta.__new__ pass **kwargs to type.__new__ #527

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

Merged
merged 3 commits into from
Mar 15, 2017

Conversation

Soares
Copy link
Contributor

@Soares Soares commented Mar 6, 2017

Many metaclasses in the standard library don't play nice with __init_subclass__. This bug makes ABCMeta in particular work with __init_subclass__, though it doesn't address other metaclasses in the standard library. 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.

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.
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA. This is necessary for legal reasons before we can look at your contribution. Please follow these steps to help rectify the issue:

  1. If you don't have an account on b.p.o, please create one
  2. Make sure your GitHub username is listed in "Your Details" at b.p.o
  3. If you have not already done so, please sign the PSF contributor agreement. The "bugs.python.org username " requested by the form is the "Login name" field under "Your Details".
  4. If you just signed the CLA, please wait at least one US business day and then check "Your Details" on bugs.python.org to see if your account has been marked as having signed the CLA (the delay is due to a person having to manually check your signed CLA)
  5. Reply here saying you have completed the above steps

Thanks again to your contribution and we look forward to looking at it!

@mention-bot
Copy link

@Soares, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @tiran, @ambv, @merwok and @doerwalter to be potential reviewers.

@Soares
Copy link
Contributor Author

Soares commented Mar 6, 2017

@the-knights-who-say-ni thanks, I have now signed the CLA

@methane
Copy link
Member

methane commented Mar 14, 2017

LGTM. Would you add NEWS entry for this? Maybe, it's like

- bpo-29581: ABCMeta.__new__ now accepts **kwargs.
  (Contributed by <YOUR NAME>

@Soares
Copy link
Contributor Author

Soares commented Mar 15, 2017

@methane Done, thanks. (Let me know if I did it wrong.)

@ambv ambv merged commit bd583ef into python:master Mar 15, 2017
@ambv
Copy link
Contributor

ambv commented Mar 15, 2017

Thanks! ✨ 🍰 ✨

Soares pushed a commit to Soares/cpython that referenced this pull request Apr 24, 2017
…#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)
Soares pushed a commit to Soares/cpython that referenced this pull request Apr 24, 2017
…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)
@Soares Soares mentioned this pull request Apr 24, 2017
Soares pushed a commit to Soares/cpython that referenced this pull request Apr 25, 2017
…#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)
Soares pushed a commit to Soares/cpython that referenced this pull request Apr 25, 2017
…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)
Mariatta pushed a commit that referenced this pull request Jun 7, 2017
…w__ (GH-527) (GH-1282)

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)

* [3.6] bpo-29581: Make ABCMeta.__new__ pass **kwargs to type.__new__ (GH-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)

* **kwargs -> ``kwargs`` in attempts to fix the Travis build.

* Quote the **kwargs
jaraco pushed a commit that referenced this pull request Dec 2, 2022
Bumps [pytest-aiohttp](https://github.com/aio-libs/pytest-aiohttp) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/aio-libs/pytest-aiohttp/releases)
- [Changelog](https://github.com/aio-libs/pytest-aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/pytest-aiohttp@v1.0.3...v1.0.4)

---
updated-dependencies:
- dependency-name: pytest-aiohttp
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mariatta Wijaya <[email protected]>
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