Skip to content
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

Pylint does not properly process a ctypes variable's value field. #4896

Closed
sidneycadot opened this issue Aug 22, 2021 · 0 comments · Fixed by pylint-dev/astroid#1154
Closed
Assignees
Labels
Bug 🪲 Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade)
Milestone

Comments

@sidneycadot
Copy link

Bug description

"""Demonstrate pylint issue."""

import ctypes

x = ctypes.c_float(1.0)

# The line below produces a strange PyLint warning:
#
#   E1101: Class 'value' has no 'is_integer' member (no-member)
#
# At runtime at least, x.value yields a 'float' value.
# It seems pylint gets tripped up by some ctypes construct.

print(x.value.is_integer())

Configuration

No response

Command used

pylint x.py

Pylint output

x.py:14:6: E1101: Class 'value' has no 'is_integer' member (no-member)

Expected behavior

I'd expect no warning.

Pylint version

pylint 2.9.6
astroid 2.6.6
Python 3.9.6 (default, Aug 16 2021, 20:37:45) 
[GCC 8.3.0]

OS / Environment

Debian

Additional dependencies

No response

@sidneycadot sidneycadot added Bug 🪲 Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Aug 22, 2021
@Pierre-Sassoulas Pierre-Sassoulas added Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade) and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Aug 22, 2021
@hippo91 hippo91 self-assigned this Aug 25, 2021
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.10.3, 2.11.0 Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Needs astroid Brain 🧠 Needs a brain tip in astroid (then an astroid upgrade)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants