Issue #1588: Add complex.__format__.

This commit is contained in:
Eric Smith 2009-04-30 01:00:33 +00:00
parent 738a41dd85
commit 58a42244cf
6 changed files with 425 additions and 52 deletions

View file

@ -54,6 +54,12 @@ PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);
PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);
PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
/* Format the object based on the format_spec, as defined in PEP 3101
(Advanced String Formatting). */
PyAPI_FUNC(PyObject *) _PyComplex_FormatAdvanced(PyObject *obj,
Py_UNICODE *format_spec,
Py_ssize_t format_spec_len);
#ifdef __cplusplus
}
#endif