Message113661
| Author |
jdwhitley |
| Recipients |
jdwhitley |
| Date |
2010年08月12日.07:12:40 |
| SpamBayes Score |
3.607447e-07 |
| Marked as misclassified |
No |
| Message-id |
<1281597162.74.0.823446392009.issue9574@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
complex() raises ValueError when parsing a string argument containing both real and imaginary where one of the real or imaginary is a decimal.
To reproduce:
>>> complex("1.1 + 2.1j")
ValueError: complex() arg is a malformed string
>>> complex("2.1j")
2.1j
>>> complex("1.1 + 2j")
ValueError: complex() arg is a malformed string
>>> complex("1 + 2.1j")
ValueError: complex() arg is a malformed string
Expected results:
>>> complex("1.1 + 2.1j")
(1.1 + 2.1j)
>>> complex("2.1j")
2.1j
>>> complex("1.1 + 2j")
(1.1 + 2j)
>>> complex("1 + 2.1j")
(1 + 2.1j)
This affects all versions up to Python 3.1.2. I haven't tested any of the development builds.
Tests were conducted on a Windows XP 32 bit machine. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年08月12日 07:12:42 | jdwhitley | set | recipients:
+ jdwhitley |
| 2010年08月12日 07:12:42 | jdwhitley | set | messageid: <1281597162.74.0.823446392009.issue9574@psf.upfronthosting.co.za> |
| 2010年08月12日 07:12:41 | jdwhitley | link | issue9574 messages |
| 2010年08月12日 07:12:40 | jdwhitley | create |
|