annotate Python/formatter_string.c @ 50618:617199769bd3 2.6

Merged revisions 68360 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r68360 | antoine.pitrou | 2009-01-06 19:10:47 +0100 (mar., 06 janv. 2009) | 7 lines Issue #1180193: When importing a module from a .pyc (or .pyo) file with an existing .py counterpart, override the co_filename attributes of all code objects if the original filename is obsolete (which can happen if the file has been renamed, moved, or if it is accessed through different paths). Patch by Ziga Seilnacht and Jean-Paul Calderone. ........
author Antoine Pitrou <solipsis@pitrou.net>
date Tue, 06 Jan 2009 19:00:59 +0000
parents 47ef9a806ce9
children 34e7c1b14495
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
b7231bf6bfb7 Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff changeset
4 of int.__float__, etc., that take and return string objects */
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
47392
47ef9a806ce9 Refactor and clean up str.format() code (and helpers) in advance of optimizations.
Eric Smith <eric@trueblade.com>
parents: 45381
diff changeset
9 #define FORMAT_STRING _PyBytes_FormatAdvanced
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_LONG _PyLong_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 #define FORMAT_INT _PyInt_FormatAdvanced
47ef9a806ce9 Refactor and clean up str.format() code (and helpers) in advance of optimizations.
Eric Smith <eric@trueblade.com>
parents: 45381
diff changeset
12 #define FORMAT_FLOAT _PyFloat_FormatAdvanced
47ef9a806ce9 Refactor and clean up str.format() code (and helpers) in advance of optimizations.
Eric Smith <eric@trueblade.com>
parents: 45381
diff changeset
13
45381
b7231bf6bfb7 Backport of PEP 3101, Advanced String Formatting, from py3k.
Eric Smith <eric@trueblade.com>
parents:
diff changeset
14 #include "../Objects/stringlib/formatter.h"