Tim Peters 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
New submission from koala-lava :
If I put -2 ** 2 in the interpreter it outputs -4. Expected is 4.
If I create a variable and initialize it with -2 and then try the same then
it's correct.
--
components: Interpreter Core
messages: 412402
nosy: koala-lava
priority: normal
severity: