comparison Objects/stringlib/string_format.h @ 65291:fd044cda97d8

#9418: first step of moving private string methods to _string module.
author Georg Brandl <georg@python.org>
date Thu, 14 Oct 2010 07:04:07 +0000
parents d3797e9dfd2c
children 05eed9f0ce01
comparison
equal deleted inserted replaced
65290:ba6581ecb6f1 65291:fd044cda97d8
1178 /* unicode_formatter_parser is used to implement 1178 /* unicode_formatter_parser is used to implement
1179 string.Formatter.vformat. it parses a string and returns tuples 1179 string.Formatter.vformat. it parses a string and returns tuples
1180 describing the parsed elements. It's a wrapper around 1180 describing the parsed elements. It's a wrapper around
1181 stringlib/string_format.h's MarkupIterator */ 1181 stringlib/string_format.h's MarkupIterator */
1182 static PyObject * 1182 static PyObject *
1183 formatter_parser(STRINGLIB_OBJECT *self) 1183 formatter_parser(PyObject *ignored, STRINGLIB_OBJECT *self)
1184 { 1184 {
1185 formatteriterobject *it; 1185 formatteriterobject *it;
1186 1186
1187 it = PyObject_New(formatteriterobject, &PyFormatterIter_Type); 1187 it = PyObject_New(formatteriterobject, &PyFormatterIter_Type);
1188 if (it == NULL) 1188 if (it == NULL)
1313 first '.' or '['; and "rest", an iterator for the rest of the field 1313 first '.' or '['; and "rest", an iterator for the rest of the field
1314 name. it's a wrapper around stringlib/string_format.h's 1314 name. it's a wrapper around stringlib/string_format.h's
1315 field_name_split. The iterator it returns is a 1315 field_name_split. The iterator it returns is a
1316 FieldNameIterator */ 1316 FieldNameIterator */
1317 static PyObject * 1317 static PyObject *
1318 formatter_field_name_split(STRINGLIB_OBJECT *self) 1318 formatter_field_name_split(PyObject *ignored, STRINGLIB_OBJECT *self)
1319 { 1319 {
1320 SubString first; 1320 SubString first;
1321 Py_ssize_t first_idx; 1321 Py_ssize_t first_idx;
1322 fieldnameiterobject *it; 1322 fieldnameiterobject *it;
1323 1323