On Thursday, January 30, 2014 10:09:03 AM UTC-5, Steven D'Aprano wrote:
> On Thu, 30 Jan 2014 09:08:58 -0500, Roy Smith wrote:
> 
> > 1) Assume that you don't have the full operator precedence table
> > memorized and just parenthesize everything.
> 
> Oh really? Do you actually write stuff like this?
> 
> b = ((2*a) + 1)

Well, OK, I exaggerated a bit.  Multiplication binds stronger than addition in 
any language I've ever used, so I assume I know that one.  But not much beyond 
that.

> if (b >= (-1)):

No, I wouldn't use either set of parens their either.  But, if I have any doubt 
at all, I rather than look it up, I just put parens.  And my threshold for 
doubt is pretty low.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to