Python buglet: Incorrect error message for float([0])

Edward C. Jones edcjones at erols.com
Wed May 1 01:07:28 EDT 2002


This line of Python (2.2):

     x = float([0])

gives the error:

     TypeError: float() needs a string argument

But since "float(0)" is OK, a better error message might be:

     TypeError: the argument of float() must be a string or a number




More information about the Python-list mailing list