Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion stdlib/3.4/enum.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ def unique(enumeration: _S) -> _S: ...
if sys.version_info >= (3, 6):
_auto_null = ... # type: Any

class auto:
class auto(IntFlag):
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment explaining why we're lying here? Maybe link to the mypy issue or PR.

Copy link
Contributor Author

@mistermocha mistermocha May 24, 2017

Choose a reason for hiding this comment

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

enum.IntFlag has all the right methods & properties to most closely match the behavior of anything returned by enum.auto()

Copy link
Member

Choose a reason for hiding this comment

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

Could you add that in the code itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I hope a docstring is apporopriate.

Copy link
Member

Choose a reason for hiding this comment

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

A comment is preferred. (Also, why is an __init__ needed?)

Copy link

Choose a reason for hiding this comment

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

As written in my comment, I don't think the comment is telling the truth but the inadvertent result of some misunderstanding. https://youtrack.jetbrains.com/issue/PY-53388/PyCharm-thinks-enumauto-needs-an-argument#focus=Comments-27-6301482.0-0

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you think there are problems with how things are implemented, please open a new issue.

Copy link

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Please open a typeshed issue if you want typeshed people to do something about it.

value = ... # type: Any
def __init__(self) -> None: pass

class Flag(Enum):
def __contains__(self: _T, other: _T) -> bool: ...
Expand Down