Message387958
I recently came across a case where this functionality would be quite useful (parsing complex values from delimited text files). We have PyLong_FromString and PyFloat_FromString, but no PyComplex_FromString (I can't find a reason why it might have been deliberately omitted).
I *think* the best current workaround is to use sscanf to parse out two floats, then feed that to PyComplex_FromDoubles, which is non-trivial.
Do others support this addition? I imagine we would just use something similar to the _Py_string_to_number_with_underscores call at the end of complex_subtype_from_string in Objects/complexobject.c. |
|
Date |
User |
Action |
Args |
2021-03-02 19:49:51 | brandtbucher | set | recipients:
+ brandtbucher |
2021-03-02 19:49:51 | brandtbucher | set | messageid: <1614714591.46.0.224854150713.issue43376@roundup.psfhosted.org> |
2021-03-02 19:49:51 | brandtbucher | link | issue43376 messages |
2021-03-02 19:49:51 | brandtbucher | create | |
|