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

gh-104683: Argument clinic: use an enum to describe the different kinds of functions #106721

Merged
merged 2 commits into from Jul 13, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jul 13, 2023

Comment on lines +2460 to +2465
INVALID: Final = FunctionKind.INVALID
CALLABLE: Final = FunctionKind.CALLABLE
STATIC_METHOD: Final = FunctionKind.STATIC_METHOD
CLASS_METHOD: Final = FunctionKind.CLASS_METHOD
METHOD_INIT: Final = FunctionKind.METHOD_INIT
METHOD_NEW: Final = FunctionKind.METHOD_NEW
Copy link
Member Author

Choose a reason for hiding this comment

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

It would be nice if we could use the @enum.global_enum decorator on the FunctionKind class; that would make this bit less verbose. Unfortunately, it was added in Python 3.11, and we still support Python 3.10 in argument clinic. Mypy also doesn't support global_enum yet.

@erlend-aasland
Copy link
Contributor

erlend-aasland commented Jul 13, 2023

LGTM! Let's wait for #106368 to land.

Also, this is a very nice improvement. Thanks!

@AlexWaygood AlexWaygood enabled auto-merge (squash) July 13, 2023 22:21
@AlexWaygood AlexWaygood merged commit 128a6c1 into python:main Jul 13, 2023
21 checks passed
kgdiem pushed a commit to kgdiem/cpython that referenced this pull request Jul 14, 2023
…nt kinds of functions (python#106721)

Argument clinic: use an enum to describe the different kinds of functions
@AlexWaygood AlexWaygood deleted the clinic-enums branch July 26, 2023 10:09
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.

None yet

3 participants