-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-74166: make all_errors keyword-only #91704
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
@@ -806,7 +806,7 @@ def getfqdn(name=''): | |||
_GLOBAL_DEFAULT_TIMEOUT = object() | |||
|
|||
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, | |||
source_address=None, all_errors=False): | |||
source_address=None, *, all_errors=False): |
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.
Is it weird that all_errors is kw-only and the others are not?
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.
Nope. It's called "legacy" :-)
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.
@@ -806,7 +806,7 @@ def getfqdn(name=''): | |||
_GLOBAL_DEFAULT_TIMEOUT = object() | |||
|
|||
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, | |||
source_address=None, all_errors=False): | |||
source_address=None, *, all_errors=False): |
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.
Nope. It's called "legacy" :-)
Thanks. Once I wanted to convert most open() parameter to keyword-only. I never recall what are positional parameter after the first two obvious arguments. But my idea got quickly rejected. "The ship has sailed", it's too late to convert positional-or-keyword parameter to keyword-only, at least without a slow deprecation process. But for new parameter, we have a great freedom to decide how to declare them! Keyword only, positional only, etc. |
No description provided.