-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression tests for Enum.name and .value inference (#4558)
Ref #1932. Ref #2062. Ref pylint-dev/astroid#1020.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# pylint: disable=missing-docstring | ||
from enum import Enum, IntEnum | ||
|
||
|
||
class Issue1932(IntEnum): | ||
"""https://github.com/PyCQA/pylint/issues/1932""" | ||
FOO = 1 | ||
|
||
def whats_my_name(self): | ||
return self.name.lower() | ||
|
||
|
||
class Issue2062(Enum): | ||
"""https://github.com/PyCQA/pylint/issues/2062""" | ||
FOO = 1 | ||
BAR = 2 | ||
|
||
def __str__(self): | ||
return self.name.lower() |