[New-bugs-announce] [issue11221] all() returns wrong result when the parameters are non-encapsulated list-comprehension

Jonathan Livni report at bugs.python.org
Wed Feb 16 09:31:39 CET 2011


New submission from Jonathan Livni <jonathan.livni at gmail.com>:

all( (x<=y) for x,y in zip(L, L[1:]) )
all([(x<=y) for x,y in zip(L, L[1:])])

Both lines of code above check if L is a non-decreasing list. Both should return the same results. But under some conditions, they don't. I've encountered this with a list of Decimal numbers.
This is 100% reproducible on my Win7 64bit vanilla Python 2.6.6 32bit setup, alas I cannot share the specific code that generates this difference.
See attached screenshot from Eclipse Pydev debugger.

----------
components: Windows
files: Eclipse.JPG
messages: 128628
nosy: Jonathan.Livni
priority: normal
severity: normal
status: open
title: all() returns wrong result when the parameters are non-encapsulated list-comprehension
versions: Python 2.6
Added file: http://bugs.python.org/file20766/Eclipse.JPG

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


More information about the New-bugs-announce mailing list