Skip to content

Conversation

@ethanfurman
Copy link
Member

@ethanfurmanethanfurman commented Jan 13, 2022

@AlexWaygood
Copy link
Member

Omg, did not mean to close that at all — sorry!!

Copy link
Member

@sobolevnsobolevn 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 your work! Enums' text representation looks way better now.

@AlexWaygood
Copy link
Member

This change appears to be causing CI to fail on docs for unrelated PRs ☹️https://github.com/python/cpython/runs/4831439882?check_suite_focus=true

@AdamWill
Copy link
Contributor

I'm curious: why does this define a __init__ for Enum which does nothing at all (just pass)?

It causes pylint to start throwing warnings about subclasses of Enum which have their own __init__ not calling super's __init__, which Python's own docs and examples don't say they should, and which of course would be pointless since it does nothing. I'm sending a PR for pylint to not emit this warning for subclasses of Enum, but I don't understand why the do-nothing __init__ was added at all.

"""Marker object for Signature.empty and Parameter.empty."""


class_ParameterKind(enum.IntEnum):

Choose a reason for hiding this comment

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

Is that inheritting correct where the values are changed to str?

Copy link
MemberAuthor

@ethanfurmanethanfurmanNov 25, 2022

Choose a reason for hiding this comment

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

@gryznar Good question: only because the __new__ uses integers as the values, and the "value" on the assignment line is saved in the description attribute. Without the custom __new__ the enum creation would have failed, since strings are not integers.

ifinvalid_names:
raiseValueError('Invalid enum member name:{0}'.format(
','.join(invalid_names)))
raiseValueError('invalid enum member name(s) '.format(

Choose a reason for hiding this comment

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

Is removing "{0}" proper?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@gryznar Only because it was changed to %s later.

Sign up for freeto 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.

7 participants

@ethanfurman@AlexWaygood@AdamWill@sobolevn@gryznar@the-knights-who-say-ni@bedevere-bot