On Tue, Mar 8, 2011 at 4:13 PM, Sylvain Thénault <
[email protected]> wrote:

> On 08 mars 16:53, Marc 'BlackJack' Rintsch wrote:
> > 08.03.2011 15:45, James Lingard <[email protected]>:
> >
> > > 1.  These warnings incorrectly warned about uses of the >> and <<
> > > operators.
> > >
> > > […]
> > >
> > > # All of the following lines incorrectly generate warnings.
> > > print 1>> 2
> > > print 1<< 2
> > > print 1 >>2
> > > print 1 <<2
> >
> > Why is a warning here incorrect?  Which of the alternatives shown is
> > more readable than ``1 << 2`` or ``1 >> 2``?  Why should these operators
> > be an exception to the "spaces around binary operator" guide line?
>

Oh, I quite agree.  But the fact is, those warnings as currently implemented
and documented are only looking for whitespace around relational operators
and assignment operators (and (for some not-at-all-obvious reason) the %
operator).  The fact that they also happened to work for >> and << was due
to a bug in the implementation, which I have fixed.

I'd be very happy to extend these warnings to check for whitespace around
all binary operators, or (probably better, since some people are probably
happy with no whitespace around an operator in an expression such as "print
a + b*c") to add two new warnings for other binary operators.

James.




>
> indeed
>
> --
> Sylvain Thénault                               LOGILAB, Paris (France)
> Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
> Développement logiciel sur mesure:       http://www.logilab.fr/services
> CubicWeb, the semantic web framework:    http://www.cubicweb.org
>
> _______________________________________________
> Python-Projects mailing list
> [email protected]
> http://lists.logilab.org/mailman/listinfo/python-projects
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to