On Monday 23 November 2009 11:36:38 Marc 'BlackJack' Rintsch wrote:
> Alexandre Fayolle wrote:
> > Therefore, imo it deserves an Error.
> 
> But it is no error.  It is perfectly legal to implement `__pos__()` in a
> way that makes sense to call it repeatedly. 

hmmm

> Even to implement that two
> successive calls increment something to mimic some C++ behaviour.  Butt
> ugly, but legal.

__pos__ with side effects. Urgh! 

If you're seeing false positives with this check, you're going to disable it 
anyway (either locally or globally in your project), so I don't think it is 
really an issue, and I'd rather have a loud complain discouraging Python 
newbies from using the construct. 

There are already legal constructs which trigger Errors in Pylint:

class Foo:
    def __init__(self):
         setattr(self, 'bar', 1)
         print self.bar # <- Error


-- 
Alexandre Fayolle                              LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Informatique scientifique:               http://www.logilab.fr/science
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to