Mercurial > cpython-lru_cache-weakref
diff Lib/string.py @ 42896:7bf8f2339ec6
PEP 3101: Removed _formatter_xxx routines from sysmodule, and made them unicode methods instead (per GvR suggestion).
| author | Eric Smith <eric@trueblade.com> |
|---|---|
| date | Mon, 27 Aug 2007 11:28:18 +0000 |
| parents | 5fd65e250843 |
| children | 4ecbae07481f |
line wrap: on
line diff
--- a/Lib/string.py Mon Aug 27 09:42:33 2007 +0000 +++ b/Lib/string.py Mon Aug 27 11:28:18 2007 +0000 @@ -200,10 +200,8 @@ # exposed here via the sys module. sys was chosen because it's always # available and doesn't have to be dynamically loaded. -# The overall parser is implemented in sys._formatter_parser. -# The field name parser is implemented in sys._formatter_field_name_split - -from sys import _formatter_parser, _formatter_field_name_split +# The overall parser is implemented in str._formatter_parser. +# The field name parser is implemented in str._formatter_field_name_split class Formatter: def format(self, format_string, *args, **kwargs): @@ -213,13 +211,13 @@ used_args = set() result = [] for (is_markup, literal, field_name, format_spec, conversion) in \ - _formatter_parser(format_string): + format_string._formatter_parser(): if is_markup: # given the field_name, find the object it references # split it into the first part, and and iterator that # looks over the rest - first, rest = _formatter_field_name_split(field_name) + first, rest = field_name._formatter_field_name_split() used_args.add(first) obj = self.get_value(first, args, kwargs)
