diff options
author | Eric Smith <eric@trueblade.com> | 2008-02-17 19:48:00 +0000 |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2008-02-17 19:48:00 +0000 |
commit | 8fd3eba0501a77eec463179f529f56025ff4b40b (patch) | |
tree | d459220bd52a30ce3de89b89ed1db077e7b5d4a4 /Include | |
parent | 18c66898b0a14761786161c07d89d65c8f088601 (diff) | |
download | cpython-git-8fd3eba0501a77eec463179f529f56025ff4b40b.tar.gz |
Fixes for shared 2.6 code that implements PEP 3101, advanced string
formatting.
Includes:
- Modifying tests for basic types to use __format__ methods, instead
of builtin "format".
- Adding PyObject_Format.
- General str/unicode cleanup discovered when backporting to 2.6.
- Removing datetimemodule.c's time_format, since it was identical
to date_format.
The files in Objects/stringlib that implement PEP 3101 (stringdefs.h,
unicodedefs.h, formatter.h, string_format.h) are identical in trunk
and py3k. Any changes from here on should be made to trunk, and
changes will propogate to py3k).
Diffstat (limited to 'Include')
-rw-r--r-- | Include/abstract.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/abstract.h b/Include/abstract.h index a496817033..9a1003b379 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -611,6 +611,13 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ + PyAPI_FUNC(PyObject *) PyObject_Format(PyObject* obj, + PyObject *format_spec); + /* + Takes an arbitrary object and returns the result of + calling obj.__format__(format_spec). + */ + /* Iterators */ PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *); |