[IronPython] Adding a string to a float - bug

Michael Foord michael.foord at resolversystems.com
Fri May 5 17:45:42 CEST 2006


Hello all,

Another IronPython peculiarity (present in beta 6) :

CPython :

Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> 2.4 + 'ff'
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: unsupported operand type(s) for +: 'float' and 'str'
 >>>


IronPython :

IronPython 1.0.60420 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 >>> 2.0 + 'ff'
Traceback (most recent call last):
  File , line 0, in input##0
  File mscorlib, line unknown, in System.IConvertible.ToDouble
  File mscorlib, line unknown, in ToDouble
  File mscorlib, line unknown, in Parse
  File mscorlib, line unknown, in ParseDouble
  File mscorlib, line unknown, in StringToNumber
SystemError: Input string was not in a correct format.
 >>>

This makes it harder to trap these errors. :-)

All the best,


Michael Foord
http://www.resolversystems.com



More information about the Ironpython-users mailing list