Python/pystrtod

Source   Edit  

Procs

proc Py_string_to_number_with_underscores(s: openArray[char]; what: cstring;
    obj: PyObject; arg: PyObject; innerfunc: proc (s: openArray[char];
    obj: PyObject): PyObject {.pyCFuncPragma.}): PyObject {.cdecl, ...raises: [],
    tags: [RootEffect], forbids: [].}

_Py_string_to_number_with_underscores

Remove underscores that follow the underscore placement rule from the string and then call the innerfunc function on the result. It should return a new object or exception.

what is used for the error message emitted when underscores are detected that don't follow the rule. arg is an opaque pointer passed to the inner function.

This is used to implement underscore-agnostic conversion for floats and complex numbers.

Source   Edit