wxPythoner@gmai l.com writes:
As explicitly defined in the language reference, the "negative"
operator has lower binding precedence than the "power" operator
<URL:http://www.python.org/doc/ref/summary.html>.
It does, if you actually have a negative number that you're raising to
power 0.
1
The parser is operating according to the documented language
specification. It can't account for the user being fooled by external
sources.
--
\ "You know what I hate? Indian givers... no, I take that back." |
`\ -- Emo Philips |
_o__) |
Ben Finney
The problem is that Python parses -123**0 as -(123**0), not as
(-123)**0.
(-123)**0.
operator has lower binding precedence than the "power" operator
<URL:http://www.python.org/doc/ref/summary.html>.
I suggest making the Python parser omit the negative sign if a
negative number is raised to the power of 0.
negative number is raised to the power of 0.
power 0.
>>(-123)**0
This is a rare case when the parser is fooled
specification. It can't account for the user being fooled by external
sources.
--
\ "You know what I hate? Indian givers... no, I take that back." |
`\ -- Emo Philips |
_o__) |
Ben Finney