[Python-ideas] Grammar for plus and minus unary ops

Nick Coghlan ncoghlan at gmail.com
Sat Mar 28 09:19:40 CET 2009

Bruce Leban wrote:
> And if you're worried about eval('+' + somecode), you've got three
> choices: (1) leave out the '+' because it has no effect

That's not true for all data types - Decimal is the one that comes to
mind as having a significant use for unary '+' (specifically, it is used
to say "round to currently defined precision, but otherwise leave the
value alone")


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list