Mercurial > cpython-lru_cache-weakref
annotate Python/formatter_string.c @ 67690:02ec1997d75e 2.7
Merged revisions 88111 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r88111 | antoine.pitrou | 2011-01-19 16:21:35 +0100 (mer., 19 janv. 2011) | 4 lines
Issue #10898: Allow compiling the posix module when the C library defines
a symbol named FSTAT.
........
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Wed, 19 Jan 2011 15:27:24 +0000 |
| parents | 2754d64180d1 |
| children |
| rev | line source |
|---|---|
|
45381
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
1 /***********************************************************************/ |
|
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
2 /* Implements the string (as opposed to unicode) version of the |
|
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
3 built-in formatters for string, int, float. That is, the versions |
|
56545
2754d64180d1
Allow core Python build to succeed under WITHOUT_COMPLEX. The module build stage still fails.
Mark Dickinson <dickinsm@gmail.com>
parents:
53629
diff
changeset
|
4 of int.__format__, etc., that take and return string objects */ |
|
45381
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
5 |
|
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
6 #include "Python.h" |
|
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
7 #include "../Objects/stringlib/stringdefs.h" |
|
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
8 |
|
53629
34e7c1b14495
Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents:
47392
diff
changeset
|
9 #define FORMAT_STRING _PyBytes_FormatAdvanced |
|
34e7c1b14495
Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents:
47392
diff
changeset
|
10 #define FORMAT_LONG _PyLong_FormatAdvanced |
|
34e7c1b14495
Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents:
47392
diff
changeset
|
11 #define FORMAT_INT _PyInt_FormatAdvanced |
|
34e7c1b14495
Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents:
47392
diff
changeset
|
12 #define FORMAT_FLOAT _PyFloat_FormatAdvanced |
|
56545
2754d64180d1
Allow core Python build to succeed under WITHOUT_COMPLEX. The module build stage still fails.
Mark Dickinson <dickinsm@gmail.com>
parents:
53629
diff
changeset
|
13 #ifndef WITHOUT_COMPLEX |
|
53629
34e7c1b14495
Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents:
47392
diff
changeset
|
14 #define FORMAT_COMPLEX _PyComplex_FormatAdvanced |
|
56545
2754d64180d1
Allow core Python build to succeed under WITHOUT_COMPLEX. The module build stage still fails.
Mark Dickinson <dickinsm@gmail.com>
parents:
53629
diff
changeset
|
15 #endif |
|
47392
47ef9a806ce9
Refactor and clean up str.format() code (and helpers) in advance of optimizations.
Eric Smith <eric@trueblade.com>
parents:
45381
diff
changeset
|
16 |
|
45381
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
17 #include "../Objects/stringlib/formatter.h" |
