Why does this (not) work?

Fredrik Lundh fredrik at pythonware.com
Tue Aug 19 23:57:36 CEST 2003

Michael C. Neel wrote:

> Hmmm, can't say I like what this implies.  In one case % is shorthand
> for a sprintf function, the other it's a mathematical expression at the
> same level of precedence of * and /.  But the sprintf version is
> "granted" the precedence of the mathematical version? What's the
> logic behind that?

it's the same "%", and the same "*".

consider the expression "a % b * c".

using your logic, do you really expect the evaluation order to vary
depending on the actual types of the objects a, b, and c?


More information about the Python-list mailing list