diff options
author | Eric Smith <eric@trueblade.com> | 2007-08-25 02:26:07 (GMT) |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2007-08-25 02:26:07 (GMT) |
commit | 8c6632636807c35bee40210ed8483c1eca82664f (patch) | |
tree | 50f386d98ce14116eaf9d83085b82ff11bdb3e69 /Include | |
parent | e4dc32488446240942123cf4e9e7296ad97e20bf (diff) | |
download | cpython-8c6632636807c35bee40210ed8483c1eca82664f.zip cpython-8c6632636807c35bee40210ed8483c1eca82664f.tar.gz cpython-8c6632636807c35bee40210ed8483c1eca82664f.tar.bz2 |
Implementation of PEP 3101, Advanced String Formatting.
Known issues:
The string.Formatter class, as discussed in the PEP, is incomplete.
Error handling needs to conform to the PEP.
Need to fix this warning that I introduced in Python/formatter_unicode.c:
Objects/stringlib/unicodedefs.h:26: warning: `STRINGLIB_CMP' defined but not used
Need to make sure sign formatting is correct, more tests needed.
Need to remove '()' sign formatting, left over from an earlier version of the PEP.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/formatter_unicode.h | 9 | ||||
-rw-r--r-- | Include/unicodeobject.h | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Include/formatter_unicode.h b/Include/formatter_unicode.h new file mode 100644 index 0000000..ccca883 --- /dev/null +++ b/Include/formatter_unicode.h @@ -0,0 +1,9 @@ +PyObject * +unicode_unicode__format__(PyObject *self, PyObject *args); + +PyObject * +unicode_long__format__(PyObject *self, PyObject *args); + +PyObject * +unicode_float__format__(PyObject *self, PyObject *args); + diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 4cde46a..f940887 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -1437,6 +1437,11 @@ PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strchr( const Py_UNICODE *s, Py_UNICODE c ); +PyObject * +_unicodeformatter_iterator(PyObject *str); +PyObject * +_unicodeformatter_lookup(PyObject *field_name, PyObject *args, + PyObject *kwargs); #ifdef __cplusplus } |