On Sat, Nov 14, 2015 at 2:48 PM, Ian Kelly <ian.g.ke...@gmail.com> wrote: >> Yes, unary minus has the same issue - but it's a lot more important >> than unary plus is. In ECMAScript, unary plus means "force this to be >> a number"; what's its purpose in Python? > > I'm not sure "force this to be a number" is really a justification. Without > it you could just use - - (but be careful not to write that as --) in the > manner of using !! as "force to boolean". Or just call Number().
I don't use it myself, but I saw something about asm.js that demonstrated the use of "x = +x;" to mean "x is a number", and "x = x|0;" to mean "x is an integer". ChrisA -- https://mail.python.org/mailman/listinfo/python-list