-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
bpo-42840: Document providing kwargs to type. #24173
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
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.
Thanks for making this PR to improve the docs! I have some minor comments.
@@ -1690,7 +1690,7 @@ are always available. They are listed here in alphabetical order. | |||
|
|||
|
|||
.. class:: type(object) | |||
type(name, bases, dict) | |||
type(name, bases, dict, **kwds) |
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.
Personally I like kwds more, but the rest of the document seems to be using **kwargs
or **kwarg
(there's one **kws
too !), so I'd suggest using **kwargs
to keep consistent.
type(name, bases, dict, **kwds) | |
type(name, bases, dict, **kwargs) |
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.
That was my initial choice, but typeshed and the section on customizing class creation in the docs mostly uses **kwds
(it also uses **kwargs
once). Given that reasoning, if you still think **kwargs
is best I'm happy to change it.
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.
Up to you. I think as it stands right now it's okay :).
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
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.
LGTM!
This PR is stale because it has been open for 30 days with no activity. |
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.
I'll merge this now. I'll mark it for backport to 3.9 and 3.8, but if those backports fail I'll just give up on them.
Thanks @esoma for the PR, and @gvanrossum for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
@gvanrossum: Please replace |
GH-24695 is a backport of this pull request to the 3.9 branch. |
GH-24696 is a backport of this pull request to the 3.8 branch. |
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> (cherry picked from commit 72fcd14) Co-authored-by: Erik Soma <stillusingirc@gmail.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> (cherry picked from commit 72fcd14) Co-authored-by: Erik Soma <stillusingirc@gmail.com>
https://bugs.python.org/issue42840