-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
pylint-dev/astroid
#1967Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeLib specific 💅This affect the code from a particular libraryThis affect the code from a particular libraryNeeds astroid updateNeeds an astroid update (probably a release too) before being mergableNeeds an astroid update (probably a release too) before being mergableNeeds investigation 🔬A bug or crash where it's not immediately obvious what is happenningA bug or crash where it's not immediately obvious what is happenninginference
Description
Bug description
For example, the prometheus_client module has an Enum class. Pylint blindly assumes that references to prometheus_client.Enum are of type enum.Enum, and issues incorrect warnings.
import prometheus_client
_foo_metric = prometheus_client.Enum('foo', 'help text', states=['bar', 'baz'])
_foo_metric.state('bar') # pylint warning: Instance of 'foo' has no 'state' memberCommand used
pylint test.pyPylint output
************* Module test
test.py:4:0: E1101: Instance of 'foo' has no 'state' member (no-member)Expected behavior
no warnings
Pylint version
pylint 2.12.1
astroid 2.9.0
Python 3.8.12 (default, Sep 23 2021, 08:42:37)
[Clang 12.0.0 (clang-1200.0.32.29)]Additional dependencies
prometheus_client==0.8.0
AriyaISIHARA and KyosukeIchikawa
Metadata
Metadata
Assignees
Labels
False Positive 🦟A message is emitted but nothing is wrong with the codeA message is emitted but nothing is wrong with the codeLib specific 💅This affect the code from a particular libraryThis affect the code from a particular libraryNeeds astroid updateNeeds an astroid update (probably a release too) before being mergableNeeds an astroid update (probably a release too) before being mergableNeeds investigation 🔬A bug or crash where it's not immediately obvious what is happenningA bug or crash where it's not immediately obvious what is happenninginference