[IronPython] Different Range Behaviour

Michael Foord michael.foord at resolversystems.com
Fri Jun 16 12:42:53 CEST 2006


Hello all,


IronPython "range" behaves slightly differently than CPython when given 
float inputs :

CPython :

 >>> range(1.0, 10.0)
__main__:1: DeprecationWarning: integer argument expected, got float
[1, 2, 3, 4, 5, 6, 7, 8, 9]

IronPython :

 >>> range(1.0, 10.0)
[1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L]

Not only does IronPython not raise the deprecation warning, but it also 
returns longs.

Michael Foord
http://www.resolversystems.com



More information about the Ironpython-users mailing list