[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 I don't know what result should be the correct 
one, but if thit IS a mistake i would prefer the result of the Int. Shell :)

--
components: Regular Expressions
messages: 160806
nosy: Marcelo.Delgado, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Interactive Shell vs Executed code
type: behavior
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14825
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 than (-7) ** 0.

BTW, it's helpful to post exact code when filing a possible bug. :-)

--
nosy: +mark.dickinson
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14825
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com