Lines Matching defs:string

12 The original string type implementation is:
223 to strings in this dictionary are *not* counted in the string's ob_refcnt.
224 When the interned string reaches a refcnt of 0 the string deallocation
228 count of a string is: s->ob_refcnt + (s->state ? 2 : 0)
250 // Return a borrowed reference to the empty string singleton.
258 // Return a strong reference to the empty string singleton.
646 makes the string ready before using it */
705 /* Subtype -- return genuine unicode string with the same value. */
740 "encoded result is too long for a Python string");
815 "encoded result is too long for a Python string");
879 /* calculate simple bloom-style bitmask for a given unicode string */
1001 /* Fill the data of a Unicode string with invalid characters to detect bugs
1200 /* We allocate one more byte to make sure the string is
1522 "Cannot modify a string currently used");
1574 /* Writing Latin-1 characters into an ASCII string requires to
1696 PyErr_SetString(PyExc_IndexError, "string index out of range");
1700 PyErr_SetString(PyExc_IndexError, "string index out of range");
1711 "in a string of %zi characters",
1726 "into a string of %s characters",
1735 correct string length can be computed before converting a string to UCS4.
1886 /* unicode_convert_wchar_to_ucs4() requires a ready string */
1930 _PyErr_WriteUnraisableMsg("deletion of interned string failed",
1939 _PyObject_ASSERT_FAILED_MSG(unicode, "Immortal interned string died");
2058 /* Copy an ASCII or latin1 char* string into a Python Unicode string.
2062 ASCII string). */
2314 obj = PyUnicode_DecodeUTF8Stateful(id->string, strlen(id->string),
2527 /* Ensure that a string uses the most efficient storage, if it is not the
2528 case: create a new string with of the right kind. Write NULL into *p_unicode
2648 as_ucs4(PyObject *string, Py_UCS4 *target, Py_ssize_t targetsize,
2654 if (PyUnicode_READY(string) == -1)
2656 kind = PyUnicode_KIND(string);
2657 data = PyUnicode_DATA(string);
2658 len = PyUnicode_GET_LENGTH(string);
2672 "string is longer than the buffer");
2698 PyUnicode_AsUCS4(PyObject *string, Py_UCS4 *target, Py_ssize_t targetsize,
2705 return as_ucs4(string, target, targetsize, copy_null);
2709 PyUnicode_AsUCS4Copy(PyObject *string)
2711 return as_ucs4(string, NULL, 0, 1);
3070 of the format string to the output string. (we cannot just
3114 "string, got a non-ASCII byte: 0x%02x",
3243 /* Convert a Unicode object to a wide character string.
4130 "path should be string, bytes, or os.PathLike, not %.200s",
4149 "path should be string, bytes, or os.PathLike, not %.200s",
4303 PyErr_SetString(PyExc_IndexError, "string index out of range");
4320 PyErr_SetString(PyExc_IndexError, "string index out of range");
4465 have+the replacement+the rest of the string (starting
4467 when there are no errors in the rest of the string) */
4494 "decoded result is too long for a Python string");
4629 /* DECODE_DIRECT: this byte encountered in a UTF-7 string should be
4632 * string. */
4845 /* end of string */
5116 // fast path: try ASCII string.
5254 On success, write a pointer to a newly allocated wide character string into
5394 On success, return 0 and write the newly allocated character string (use
5529 Allocation strategy: if the string is short, convert into a stack buffer
5561 /* the string cannot be ASCII, or PyUnicode_UTF8() would be set */
5583 /* the string cannot be ASCII, or PyUnicode_UTF8() would be set */
5933 encoding of a string containing isolated surrogates and the 'ignore'
6272 encoding of a string containing isolated surrogates and the 'ignore' handler
6323 Unicode string, so we start with size here and then reduce the
6325 (but if the error callback returns a long replacement string
6367 message = "\\ at end of string";
6588 /* Return a Unicode-Escape string version of the Unicode object. */
6730 Unicode string, so we start with size here and then reduce the
6732 handler might have to resize the string) */
6769 message = "\\ at end of string";
6987 put the result into newpos and return the replacement string, which
7238 /* Fast path: if it is a one-byte string, construct
7364 /* Fast path: if it is an ASCII-only string, construct bytes object
7425 * Decode a byte string from a Windows code page into unicode object in strict
7475 * Decode a byte string from a code page into unicode object with an error
7535 /* Decode the byte string character per character */
7718 * Encode a Unicode string to a Windows code page into a byte string in strict
7783 /* Create string object */
7791 /* Extend string object */
7834 * Encode a Unicode string to a Windows code page into a byte string using an
7894 /* Create string object */
7901 /* Extend string object */
7912 /* Encode the string character per character */
8403 PyUnicode_BuildEncodingMap(PyObject* string)
8418 if (!PyUnicode_Check(string) || !PyUnicode_GET_LENGTH(string)) {
8422 kind = PyUnicode_KIND(string);
8423 data = PyUnicode_DATA(string);
8424 length = PyUnicode_GET_LENGTH(string);
8605 /* lookup the character, put the result in the output string and adjust
8923 put the result into newpos and return the replacement string, which
9136 /* Fast path for ascii => ascii translation. Return 1 if the whole string
9137 was translated into writer, return 0 if the input string was partially
9330 /* If the string is already ASCII, just return the same string */
9477 * @d_pos: Start of digits string.
9478 * @n_digits: The number of digits in the string, in which we want
9480 * @min_width: The minimum width of the digits in the output string.
9548 should be an empty string */
10007 PyErr_SetString(PyExc_OverflowError, "string is too long");
10154 "join() result is too long for a Python string");
10264 PyErr_SetString(PyExc_IndexError, "string index out of range");
10270 "the string maximum character");
10304 PyErr_SetString(PyExc_OverflowError, "padded string is too long");
10325 PyUnicode_Splitlines(PyObject *string, int keepends)
10329 if (ensure_unicode(string) < 0)
10332 switch (PyUnicode_KIND(string)) {
10334 if (PyUnicode_IS_ASCII(string))
10336 string, PyUnicode_1BYTE_DATA(string),
10337 PyUnicode_GET_LENGTH(string), keepends);
10340 string, PyUnicode_1BYTE_DATA(string),
10341 PyUnicode_GET_LENGTH(string), keepends);
10345 string, PyUnicode_2BYTE_DATA(string),
10346 PyUnicode_GET_LENGTH(string), keepends);
10350 string, PyUnicode_4BYTE_DATA(string),
10351 PyUnicode_GET_LENGTH(string), keepends);
10640 result string. */
10768 "replace string is too long");
10778 "replace string is too long");
10802 /* copy substitution string */
10858 /* nothing to replace; return original string (when possible) */
10888 Return a version of the string where each word is titlecased.
10906 Return a capitalized version of the string.
10926 Return a version of the string suitable for caseless comparisons.
10972 Return a centered string of length width.
11157 /* a string is equal to itself */
11181 /* Compare Unicode string and source character set string */
11217 /* Compare Unicode string and source character set string */
11278 assert(right->string);
11280 for (const char *p = right->string; *p; p++) {
11288 return non_ready_unicode_equal_to_ascii_string(left, right->string);
11298 return _PyUnicode_EqualToASCIIString(left, right->string);
11333 /* a string is equal to itself */
11371 "'in <string>' requires string as left operand, not %.100s",
11422 /* Concat to string or Unicode object giving a new Unicode object. */
11527 not so different than duplicating the string. */
11588 string S[start:end]. Optional arguments start and end are\n\
11659 The encoding in which to encode the string.
11667 Encode the string using the codec registered for encoding.
11702 /* First pass: determine size of output string */
11732 /* Second pass: create output string and fill it */
11762 PyErr_SetString(PyExc_OverflowError, "new string is too long");
11813 PyErr_SetString(PyExc_IndexError, "string index out of range");
11883 Return True if all characters in the string are ASCII, False otherwise.
11886 Empty string is ASCII too.
11902 Return True if the string is a lowercase string, False otherwise.
11904 A string is lowercase if all cased characters in the string are lowercase and
11905 there is at least one cased character in the string.
11947 Return True if the string is an uppercase string, False otherwise.
11949 A string is uppercase if all cased characters in the string are uppercase and
11950 there is at least one cased character in the string.
11992 Return True if the string is a title-cased string, False otherwise.
11994 In a title-cased string, upper- and title-case characters may only
12050 Return True if the string is a whitespace string, False otherwise.
12052 A string is whitespace if all characters in the string are whitespace and there
12053 is at least one character in the string.
12090 Return True if the string is an alphabetic string, False otherwise.
12092 A string is alphabetic if all characters in the string are alphabetic and there
12093 is at least one character in the string.
12129 Return True if the string is an alpha-numeric string, False otherwise.
12131 A string is alpha-numeric if all characters in the string are alpha-numeric and
12132 there is at least one character in the string.
12171 Return True if the string is a decimal string, False otherwise.
12173 A string is a decimal string if all characters in the string are decimal and
12174 there is at least one character in the string.
12210 Return True if the string is a digit string, False otherwise.
12212 A string is a digit string if all characters in the string are digits and there
12213 is at least one character in the string.
12250 Return True if the string is a numeric string, False otherwise.
12252 A string is numeric if all characters in the string are numeric and there is at
12253 least one character in the string.
12295 /* an empty string is not a valid identifier */
12329 /* an empty string is not a valid identifier */
12337 /* an empty string is not a valid identifier */
12379 Return True if the string is a valid Python identifier, False otherwise.
12381 Call keyword.iskeyword(s) to test whether string s is a reserved identifier,
12395 Return True if the string is printable, False otherwise.
12397 A string is printable if all of its characters are considered printable in
12436 The string whose method is called is inserted in between each given string.
12437 The result is returned as a new string.
12464 Return a left-justified string of length width.
12485 Return a copy of the string converted to lowercase.
12576 PyErr_SetString(PyExc_IndexError, "string index out of range");
12686 Return a copy of the string with leading and trailing whitespace removed.
12705 Return a copy of the string with leading whitespace removed.
12724 Return a copy of the string with trailing whitespace removed.
12746 /* no repeat, return original string */
12755 "repeated string is too long");
12838 Return a str with the given prefix string removed if present.
12840 If the string starts with the prefix string, return string[len(prefix):].
12841 Otherwise, return a copy of the original string.
12865 Return a str with the given suffix string removed if present.
12867 If the string ends with the suffix string and that suffix is not empty,
12868 return string[:-len(suffix)]. Otherwise, return a copy of the original
12869 string.
12936 "string is too long to generate repr");
13128 Return a right-justified string of length width.
13159 The separator used to split the string.
13168 Return a list of the substrings in the string, using sep as the separator string.
13300 Partition the string into three parts using the given separator.
13302 This will search for the separator in the string. If the separator is found,
13306 If the separator is not found, returns a 3-tuple containing the original string
13320 Partition the string into three parts using the given separator.
13322 This will search for the separator in the string, starting at the end. If
13327 and the original string.
13349 Return a list of the substrings in the string, using sep as the separator string.
13351 Splitting starts at the end of the string and works to the front.
13374 Return a list of the lines in the string, breaking at line boundaries.
13429 must be a string, whose characters will be mapped to None in the result.
13447 /* x must be a string too, of equal length */
13450 "be a string if there is a second argument");
13502 /* copy entries into the new dict, converting string keys to int keys */
13505 /* convert string keys to integer keys */
13508 PyErr_SetString(PyExc_ValueError, "string keys in translate "
13546 Replace each character in the string using the given translation table.
13563 Return a copy of the string converted to uppercase.
13583 Pad a numeric string with zeros on the left, to fill a field of the given width.
13585 The string is never truncated.
13616 /* move sign to beginning of string */
14091 Return a formatted version of the string as described by format_spec.
14117 Return the size of the string in memory, in bytes.
14307 PyErr_Format(PyExc_TypeError, "string indices must be integers, not '%.200s'",
14357 "not enough arguments for format string");
14408 * The output string is of the form
14470 /* To modify the string in-place, there can only be one reference. */
14481 "string too large in _PyUnicode_FormatLong");
14873 (ctx->writer). A string is created when padding is required.
15017 /* Truncate the string for "s", "r" and "a" formats
15178 "not all arguments converted during string formatting");
15250 "not all arguments converted during string formatting");
15405 Create a new string object from the given object. If encoding or\n\
16168 to the string.Formatter class implemented in Python. */
16174 METH_O, PyDoc_STR("parse the argument as a format string")},
16181 .m_doc = PyDoc_STR("string helper module"),