Skip to content
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

Add keyword arguments for Functional Enum API #9123

Merged
merged 1 commit into from
Jul 22, 2020

Conversation

LiuYuHui
Copy link
Contributor

fix #9079

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Looks good. I left a few ideas for improvements; feel free to implement them in a separate PR. I'm going to merge this as is since this is already a good improvement.

if arg_name == 'value':
value = arg
if arg_name == 'names':
names = arg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These additional improvements would be nice:

  • Make sure that only at most the first two arguments are given as positional arguments (the others are keyword-only).
  • If some argument is given as a keyword argument, ensure that they aren't also given as positional arguments.

@JukkaL JukkaL merged commit 03815d6 into python:master Jul 22, 2020
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.

Bug: Functional Enum API Unexpected arguments to Enum()
2 participants