pylint-bot / pylint-unofficial

UNOFFICIAL playground for pylint github migration
0 stars 0 forks source link

no-member false positive for tokenize.INDENT #661

Open pylint-bot opened 9 years ago

pylint-bot commented 9 years ago

Originally reported by: Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore)


pylint emits a no-member error for tokenize.INDENT. This is happening because tokenize imports the tokens from token.py using star import. In token.py, the __all__ variable is computed dynamically, using this pattern:

#!python

tok_name = {value: name
            for name, value in globals().items()
            if isinstance(value, int) and not name.startswith('_')}
__all__.extend(tok_name.values())

This pattern is becoming extremely popular lately and it causes quite a lot of false positives when encountered. There are some solutions we could use:

I'll tackle the last point after 1.5.