On Mon, Mar 17, 2014 at 12:15 PM, Marko Rauhamaa <ma...@pacujo.net> wrote: > Is "-2.0" a literal? > > What's the outcome of > > -2.0.__str__()
No. The compiler will try to optimize it into a single constant if it can, but it has to be done in accordance with the order of operations. In that example, the __str__ method is called before the unary - is applied, resulting in an error. -- https://mail.python.org/mailman/listinfo/python-list