[Python-projects] Suggestion about E1101 Instance of 'None' has no 'get' member
Barry Scott
barry.scott at onelan.co.uk
Thu Dec 14 12:34:47 CET 2006
Nicolas Chauvat wrote:
> On Wed, Dec 13, 2006 at 10:19:23PM +0000, Michael Foord wrote:
>
>
>>> def __pylint_hint( self ):
>>> assert isinstance( self.some_object, some_module.SomeClass )
>>>
>>>
>> This is how the Wing IDE does code completion (where it can't divine
>> the type).
>>
>> Personally I don't like the idea of adding to production code just to
>> help PyLint or my IDE, but many people like it.
>>
>
> FWIW, I do not like the idea of adding things to production code to
> help pylint, except adding things like comments (as in pylint-disable)
> or items in docstrings (as in the contracts in logilab-aspects).
>
>
I would prefer using a comment, as I first suggested, to adding code as
well.
But if the only way this got implemented is by adding code I'd like that
method to
have no effect at runtime. Having functions that are never called would
work.
I wonder is it would be possible to add to python a builtin that passed
info to
analyzers? That way the AST would have the info in its tree and the python
compiler could ignore the construct.
Barry
More information about the Python-Projects
mailing list