Martin v. Löwis <mar...@v.loewis.de> added the comment:

This is expected behavior. The power operator binds with higher precedence than 
the unary minus:

http://docs.python.org/reference/expressions.html#unary-arithmetic-and-bitwise-operations

Therefore, your term is interpreted as

-(4 ** 2)

As for "it only affects the prompt": I can't reproduce that. If I put

print(-4**2)

in a script and run that, it still prints -16 for me.

----------
nosy: +loewis
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

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

Reply via email to