Message113689
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. |
|
Date |
User |
Action |
Args |
2010-08-12 17:18:50 | belopolsky | set | recipients:
+ belopolsky, mark.dickinson, jdwhitley |
2010-08-12 17:18:50 | belopolsky | set | messageid: <1281633530.89.0.744723486422.issue9574@psf.upfronthosting.co.za> |
2010-08-12 17:18:49 | belopolsky | link | issue9574 messages |
2010-08-12 17:18:48 | belopolsky | create | |
|