[issue14825] Interactive Shell vs Executed code

2012-05-16 Thread Marcelo Delgado
New submission from Marcelo Delgado marde...@gmail.com: I have found inconsistency between running this code in the interactive shell and running it from a file: Int. Shell: n**0 ## n is a negative number result: -1 File: n**0 ## n is a negative number result: 1 I am fairly new to Python, so

[issue14825] Interactive Shell vs Executed code

2012-05-16 Thread Marcelo Delgado
Changes by Marcelo Delgado marde...@gmail.com: -- components: +Interpreter Core -Regular Expressions ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14825 ___

[issue14825] Interactive Shell vs Executed code

2012-05-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: It sounds like you're seeing the difference between this: n = -7 n ** 0 1 and this: -7 ** 0 -1 This isn't a bug; it's to do with how Python expressions are parsed: in the second case, the expression is grouped as -(7 ** 0) rather