Author belopolsky
Recipients belopolsky, jdwhitley, mark.dickinson
Date 2010-08-12.17:18:48
SpamBayes Score 2.05038e-10
Marked as misclassified No
Message-id <1281633530.89.0.744723486422.issue9574@psf.upfronthosting.co.za>
In-reply-to
Content
Current behavior is also consistent with that of fractions:

>>> Fraction("1/2")
Fraction(1, 2)
>>> Fraction("1 / 2")
Traceback (most recent call last):
  ..
ValueError: Invalid literal for Fraction: '1 / 2'

I am -1 on this RFE.  At most, this can be clarified in the docs.

Allowing whitespace involves too much uncertainly.  Would you allow any white space or just chr(0x20)?  End-of-line or tab in complex numbers is most likely a typo and should be flagged.  What about more exotic unicode whitespace such as chr(0x00A0) or chr(0x2009)?  Allow one or any number of whitespace characters?

Users who need a more powerful parser can use eval() or simply remove spaces from their strings before converting them to numbers.
History
Date User Action Args
2010-08-12 17:18:50belopolskysetrecipients: + belopolsky, mark.dickinson, jdwhitley
2010-08-12 17:18:50belopolskysetmessageid: <1281633530.89.0.744723486422.issue9574@psf.upfronthosting.co.za>
2010-08-12 17:18:49belopolskylinkissue9574 messages
2010-08-12 17:18:48belopolskycreate