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

namedtuple no-member false positives #92

Closed
pylint-bot opened this issue Oct 8, 2013 · 3 comments
Closed

namedtuple no-member false positives #92

pylint-bot opened this issue Oct 8, 2013 · 3 comments
Labels

Comments

@pylint-bot
Copy link

Originally reported by: Jonathan Kotta (BitBucket: jpkotta, GitHub: @jpkotta?)


If a namedtuple is defined with a string, there must be whitespace around each member. In particular, a namedtuple definition with a comma-separated string doesn't work.

Also, the standard methods _make(), _asdict(), and _fields() are not recognized.

$ pylint --version
No config file found, using default configuration
pylint 1.0.0, 
astroid 1.0.0, common 0.60.0
Python 3.3.2 (default, Sep  6 2013, 09:30:10) 
[GCC 4.8.1 20130725 (prerelease)]

astroid is actually not the released 1.0.0, but this rev: https://bitbucket.org/logilab/astroid/commits/5ed6266cab789bc89d882444c938f03953491496


@pylint-bot
Copy link
Author

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


I can't reproduce the problem with comma separated members. My version is:

#!sh

pylint-script.py 1.1.0,
astroid 1.0.1, common 0.60.1
Python 3.4.0rc1 (v3.4.0rc1:5e088cea8660, Feb 11 2014, 05:55:13) [MSC v.1600 64 bit (AMD64)]

Regarding the false positive with _make(), _asdict() and _fields(), it was fixed in pylint-brain with commit https://bitbucket.org/logilab/pylint-brain/commits/a43ebb6c6d7a4afcaf55ff86b38fdc0051ef7247.

@pylint-bot
Copy link
Author

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


This seems to be fixed in pylint-brain and it's not a problem anymore.

@pylint-bot
Copy link
Author

Original comment by Florian Bruhin (BitBucket: The-Compiler, GitHub: @The-Compiler?):


With pylint 1.2.1, Python 3.4.1 and astroid 1.1.1 I still get the following with the provided test script:

E:  7, 8: Instance of 'Bad' has no 'a' member (no-member)
W:  8, 7: Access to a protected member _replace of a client class (protected-access)
W:  9, 8: Access to a protected member _asdict of a client class (protected-access)
W: 10, 8: Access to a protected member _fields of a client class (protected-access)
E: 10, 8: Instance of 'Good' has no '_fields' member (no-member)

msuozzo pushed a commit to msuozzo/pylint that referenced this issue Feb 18, 2022
msuozzo pushed a commit to msuozzo/pylint that referenced this issue Feb 18, 2022
Note that the synthtool-generated `.coveragerc` (see pylint-dev#224) does *not* include all changes needed for 100% coverage:  see:

- googleapis/gapic-generator-python#171
- googleapis/gapic-generator-python#437

Closes pylint-dev#92.
Closes pylint-dev#195.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant