Message128628
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. |
|
Date |
User |
Action |
Args |
2011-02-16 08:31:39 | Jonathan.Livni | set | recipients:
+ Jonathan.Livni |
2011-02-16 08:31:39 | Jonathan.Livni | set | messageid: <1297845099.14.0.722609580039.issue11221@psf.upfronthosting.co.za> |
2011-02-16 08:31:38 | Jonathan.Livni | link | issue11221 messages |
2011-02-16 08:31:38 | Jonathan.Livni | create | |
|