Mercurial > cpython-lru_cache-weakref
annotate Python/formatter_unicode.c @ 56700:2146bbdf4ed7 legacy-trunk
Issue #7117: Prepare for backport of py3k float repr.
Add the Python/dtoa.c file containing the main algorithms;
add corresponding include file and include in Python.h;
include license information for Python/dtoa.c;
add dtoa.c and dtoa.h to Makefile.
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Sat, 24 Oct 2009 12:13:30 +0000 |
| parents | 34e7c1b14495 |
| children |
| rev | line source |
|---|---|
|
45381
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
1 /* Implements the unicode (as opposed to string) version of the |
|
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
2 built-in formatter for unicode. That is, unicode.__format__(). */ |
|
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
3 |
|
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
4 #include "Python.h" |
|
51032
551257c8058a
fix building the core with --disable-unicode
Benjamin Peterson <benjamin@python.org>
parents:
47392
diff
changeset
|
5 |
|
551257c8058a
fix building the core with --disable-unicode
Benjamin Peterson <benjamin@python.org>
parents:
47392
diff
changeset
|
6 #ifdef Py_USING_UNICODE |
|
551257c8058a
fix building the core with --disable-unicode
Benjamin Peterson <benjamin@python.org>
parents:
47392
diff
changeset
|
7 |
|
45381
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
8 #include "../Objects/stringlib/unicodedefs.h" |
|
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
9 |
|
47392
47ef9a806ce9
Refactor and clean up str.format() code (and helpers) in advance of optimizations.
Eric Smith <eric@trueblade.com>
parents:
45381
diff
changeset
|
10 #define FORMAT_STRING _PyUnicode_FormatAdvanced |
|
47ef9a806ce9
Refactor and clean up str.format() code (and helpers) in advance of optimizations.
Eric Smith <eric@trueblade.com>
parents:
45381
diff
changeset
|
11 |
|
53629
34e7c1b14495
Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents:
51032
diff
changeset
|
12 /* don't define FORMAT_LONG, FORMAT_FLOAT, and FORMAT_COMPLEX, since |
|
34e7c1b14495
Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents:
51032
diff
changeset
|
13 we can live with only the string versions of those. The builtin |
|
34e7c1b14495
Issue #1588: Add complex.__format__.
Eric Smith <eric@trueblade.com>
parents:
51032
diff
changeset
|
14 format() will convert them to unicode. */ |
|
47392
47ef9a806ce9
Refactor and clean up str.format() code (and helpers) in advance of optimizations.
Eric Smith <eric@trueblade.com>
parents:
45381
diff
changeset
|
15 |
|
45381
b7231bf6bfb7
Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
16 #include "../Objects/stringlib/formatter.h" |
|
51032
551257c8058a
fix building the core with --disable-unicode
Benjamin Peterson <benjamin@python.org>
parents:
47392
diff
changeset
|
17 |
|
551257c8058a
fix building the core with --disable-unicode
Benjamin Peterson <benjamin@python.org>
parents:
47392
diff
changeset
|
18 #endif |
