Justin added the comment:

I think there is a misunderstanding of precedence here. If we had an operation 
were -1 * 5**4, I could fully understand the statement of precedence. However, 
in the absence of the "-1 *", the -5 becomes a single atom.

For example:
>>> myVal = -5
>>> myVal**4
625
>>> # not -625 because it is treated as a single atom.

The statement -5**4 - 20, should yield the same result and yet, it does not.

>>> -5**4 - 20
-645
>>> 5**4 - 20
605
>>>

Let's take the reverse side of this

take 4**-2, if precedence is to hold the same way, why would this not be 16 
instead of the correct answer of 0.0625. In this instance, the unary sign all 
of a sudden jumped in precedence and became a single atom.

>>> 4**-2
0.0625

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23429>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to