Tim Peters <t...@python.org> added the comment:

Exponentiation has higher precedence (binds more tightly) than unary minus, so 
the expression groups as -(2**2).

Virtually all computer languages (those that _have_ an exponentiation operator) 
do the same. For example, here from wxMaxima:

(%i1) -2**2;
(%o1) -4

Closing as not-a-bug.

----------
nosy: +tim.peters
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
versions:  -Python 3.10

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

Reply via email to