Message79548
| Author | aronacher |
|---|---|
| Recipients | aronacher |
| Date | 2009-01-10.15:45:00 |
| SpamBayes Score | 0.028499166 |
| Marked as misclassified | No |
| Message-id | <1231602302.94.0.22786815912.issue4907@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
ast.literal_eval does not properly handle complex numbers:
>>> ast.literal_eval("1j")
1j
>>> ast.literal_eval("2+1j")
Traceback (most recent call last):
...
ValueError: malformed string
>>> ast.literal_eval("(2+1j)")
Traceback (most recent call last):
...
ValueError: malformed string
Expected result:
>>> ast.literal_eval("1j")
1j
>>> ast.literal_eval("2+1j")
(2+1j)
>>> ast.literal_eval("(2+1j)")
(2+1j)
I attached a patch that fixes this problem. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2009-01-10 15:45:03 | aronacher | set | recipients: + aronacher |
| 2009-01-10 15:45:02 | aronacher | set | messageid: <1231602302.94.0.22786815912.issue4907@psf.upfronthosting.co.za> |
| 2009-01-10 15:45:01 | aronacher | link | issue4907 messages |
| 2009-01-10 15:45:01 | aronacher | create | |