Skip to content

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

Merged
merged 1 commit into from
Apr 19, 2022
Merged

Conversation

iritkatriel
Copy link
Member

No description provided.

@@ -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):
Copy link
Member Author

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?

Copy link
Member

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" :-)

Copy link
Member

@vstinner vstinner left a 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):
Copy link
Member

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" :-)

@vstinner
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants