[New-bugs-announce] [issue15692] Unexpected exponentiation in lambda function

Björn Dahlgren report at bugs.python.org
Thu Aug 16 17:30:12 CEST 2012


New submission from Björn Dahlgren:

Hi, I hope this is not a false positive but I cannot help thinking this is a bug, consider:

Python 2.7.3 (default, Aug  1 2012, 05:14:39) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> -3.2**0
-1.0
>>> sign=lambda x: x**0
>>> sign(-3.2)
1.0

Python 3.2.3 (default, May  3 2012, 15:51:42) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> -3.2**0
-1.0
>>> sign=lambda x: x**0
>>> sign(-3.2)
1.0


Or is this expected?

Best regards,
Björn Dahlgren

----------
components: None
messages: 168384
nosy: bjodah
priority: normal
severity: normal
status: open
title: Unexpected exponentiation in lambda function
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15692>
_______________________________________


More information about the New-bugs-announce mailing list