Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:

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.

----------
nosy: +belopolsky

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9574>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to