-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enum: Method 'name' has no 'lower' member (no-member) #2062
Labels
Comments
geckon
added a commit
to geckon/hockepy
that referenced
this issue
May 4, 2018
Fix for #29 introduced two pylint "errors" which I believe are bugs in pylint though. The latest pylint version 1.8.4 doesn't help though and so I reported two issues to pylint: pylint-dev/pylint#2062 pylint-dev/pylint#2063 Hockepy will probably have broken builds due to these false positive pylint errors until those two issues are fixed.
Thanks, I can reproduce this issue. |
Will take a look into this tonight! |
slaperche-scality
added a commit
to scality/metalk8s
that referenced
this issue
Jul 15, 2019
Pylint seems to think that `name` is a method instead of a string, which is wrong. See pylint-dev/pylint#2062 Refs: #1410 Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality
added a commit
to scality/metalk8s
that referenced
this issue
Jul 15, 2019
Pylint seems to think that `name` is a method instead of a string, which is wrong. See pylint-dev/pylint#2062 Refs: #1410 Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality
added a commit
to scality/metalk8s
that referenced
this issue
Jul 16, 2019
Pylint seems to think that `name` is a method instead of a string, which is wrong. See pylint-dev/pylint#2062 Refs: #1410 Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality
added a commit
to scality/metalk8s
that referenced
this issue
Jul 16, 2019
Pylint seems to think that `name` is a method instead of a string, which is wrong. See pylint-dev/pylint#2062 Refs: #1410 Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality
added a commit
to scality/metalk8s
that referenced
this issue
Jul 18, 2019
Pylint seems to think that `name` is a method instead of a string, which is wrong. See pylint-dev/pylint#2062 Refs: #1410 Signed-off-by: Sylvain Laperche <[email protected]>
slaperche-scality
added a commit
to scality/metalk8s
that referenced
this issue
Jul 18, 2019
Pylint seems to think that `name` is a method instead of a string, which is wrong. See pylint-dev/pylint#2062 Refs: #1410 Signed-off-by: Sylvain Laperche <[email protected]>
MonPote
pushed a commit
to scality/metalk8s
that referenced
this issue
Jul 25, 2019
Pylint seems to think that `name` is a method instead of a string, which is wrong. See pylint-dev/pylint#2062 Refs: #1410 Signed-off-by: Sylvain Laperche <[email protected]>
Any update on this task? |
@dineshtrivedi apparently no one has worked on this yet. Maybe @befreeman ? |
nelfin
added a commit
to nelfin/astroid
that referenced
this issue
Jun 10, 2021
Ref pylint-dev/pylint#1932. Ref pylint-dev/pylint#2062. The enum.Enum class itself defines two @DynamicClassAttribute data-descriptors "name" and "value" which behave differently when looked up on an instance or on the class. When dealing with inference of an arbitrary instance of the enum class, e.g. in a method defined in the class body like: class SomeEnum(enum.Enum): def method(self): self.name # <- here we should assume that "self.name" is the string name of some enum member, unless the enum itself defines a "name" member.
2 tasks
nelfin
added a commit
to nelfin/pylint
that referenced
this issue
Jun 10, 2021
4 tasks
nelfin
added a commit
to nelfin/astroid
that referenced
this issue
Jun 10, 2021
Ref pylint-dev/pylint#1932. Ref pylint-dev/pylint#2062. The enum.Enum class itself defines two @DynamicClassAttribute data-descriptors "name" and "value" which behave differently when looked up on an instance or on the class. When dealing with inference of an arbitrary instance of the enum class, e.g. in a method defined in the class body like: class SomeEnum(enum.Enum): def method(self): self.name # <- here we should assume that "self.name" is the string name of some enum member, unless the enum itself defines a "name" member.
Pierre-Sassoulas
added a commit
to pylint-dev/astroid
that referenced
this issue
Jun 13, 2021
* Add DynamicClassAttribute to list of properties DynamicClassAttribute is a descriptor defined in Python's Lib/types.py which changes the behaviour of an attribute depending on if it is looked up on the class or on an instance. * Add fake "name" property to enum.Enum subclasses Ref pylint-dev/pylint#1932. Ref pylint-dev/pylint#2062. The enum.Enum class itself defines two @DynamicClassAttribute data-descriptors "name" and "value" which behave differently when looked up on an instance or on the class. When dealing with inference of an arbitrary instance of the enum class, e.g. in a method defined in the class body like: class SomeEnum(enum.Enum): def method(self): self.name # <- here we should assume that "self.name" is the string name of some enum member, unless the enum itself defines a "name" member. Co-authored-by: Pierre Sassoulas <[email protected]>
nelfin
added a commit
to nelfin/pylint
that referenced
this issue
Jun 13, 2021
cdce8p
pushed a commit
that referenced
this issue
Jun 16, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Run
pylint
on the file above.Current behavior
E: 10,15: Method 'name' has no 'lower' member (no-member)
Expected behavior
No error. Enums have
name
propery which contains a string.pylint --version output
The text was updated successfully, but these errors were encountered: