logilab-astng #8766 support for namedtuple [done]
Maarteen in python-projects: on the following program pylint issues a false positive: from urlparse import urlparse print urlparse('http://www.logilab.org/project/pylint').path E1101: 2: Instance of 'ParseResult' has no 'path' member Here astng correctly infers that urlparse() returns a ParseResult instance, but doesn't know that ParseResult has a "path" member. This is the line in urlparse.py that defines ParseResult: class ParseResult(namedtuple('ParseResult', 'scheme netloc path params query fragment'), ResultMixin):
The class using namedtuple() explicitly lists the members it acquires; it would be very useful if pylint would consider these members present. | |
priority | normal |
---|---|
type | enhancement |
done in | <not specified> |
load | 0.500 |
load left | 0.000 |
closed by | #817425accd09 namedtuple support using extended transformation function features. Closes #8766 |
similar entities
- pylint #4593 pylint complains when initializing attribute via property()
- pylint #6708 detecting when it's safe to ignore builtin overrides
- logilab-astng #905 proper metaclass support
- pylint #9223 __future__ module does not contain real symbols
- pylint #18778 W0613 false positive on overridden dictionary methods
[see all]