#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
# include "pycore_gc.h"
# include "pycore_runtime.h"
#endif
#include "pycore_abstract.h"
#include "pycore_modsupport.h"
PyDoc_STRVAR(EncodingMap_size__doc__,
"size($self, /)\n"
"--\n"
"\n"
"Return the size (in bytes) of this object.");
#define ENCODINGMAP_SIZE_METHODDEF …
static PyObject *
EncodingMap_size_impl(struct encoding_map *self);
static PyObject *
EncodingMap_size(struct encoding_map *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_title__doc__,
"title($self, /)\n"
"--\n"
"\n"
"Return a version of the string where each word is titlecased.\n"
"\n"
"More specifically, words start with uppercased characters and all remaining\n"
"cased characters have lower case.");
#define UNICODE_TITLE_METHODDEF …
static PyObject *
unicode_title_impl(PyObject *self);
static PyObject *
unicode_title(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_capitalize__doc__,
"capitalize($self, /)\n"
"--\n"
"\n"
"Return a capitalized version of the string.\n"
"\n"
"More specifically, make the first character have upper case and the rest lower\n"
"case.");
#define UNICODE_CAPITALIZE_METHODDEF …
static PyObject *
unicode_capitalize_impl(PyObject *self);
static PyObject *
unicode_capitalize(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_casefold__doc__,
"casefold($self, /)\n"
"--\n"
"\n"
"Return a version of the string suitable for caseless comparisons.");
#define UNICODE_CASEFOLD_METHODDEF …
static PyObject *
unicode_casefold_impl(PyObject *self);
static PyObject *
unicode_casefold(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_center__doc__,
"center($self, width, fillchar=\' \', /)\n"
"--\n"
"\n"
"Return a centered string of length width.\n"
"\n"
"Padding is done using the specified fill character (default is a space).");
#define UNICODE_CENTER_METHODDEF …
static PyObject *
unicode_center_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar);
static PyObject *
unicode_center(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_count__doc__,
"count($self, sub[, start[, end]], /)\n"
"--\n"
"\n"
"Return the number of non-overlapping occurrences of substring sub in string S[start:end].\n"
"\n"
"Optional arguments start and end are interpreted as in slice notation.");
#define UNICODE_COUNT_METHODDEF …
static Py_ssize_t
unicode_count_impl(PyObject *str, PyObject *substr, Py_ssize_t start,
Py_ssize_t end);
static PyObject *
unicode_count(PyObject *str, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_encode__doc__,
"encode($self, /, encoding=\'utf-8\', errors=\'strict\')\n"
"--\n"
"\n"
"Encode the string using the codec registered for encoding.\n"
"\n"
" encoding\n"
" The encoding in which to encode the string.\n"
" errors\n"
" The error handling scheme to use for encoding errors.\n"
" The default is \'strict\' meaning that encoding errors raise a\n"
" UnicodeEncodeError. Other possible values are \'ignore\', \'replace\' and\n"
" \'xmlcharrefreplace\' as well as any other name registered with\n"
" codecs.register_error that can handle UnicodeEncodeErrors.");
#define UNICODE_ENCODE_METHODDEF …
static PyObject *
unicode_encode_impl(PyObject *self, const char *encoding, const char *errors);
static PyObject *
unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(unicode_expandtabs__doc__,
"expandtabs($self, /, tabsize=8)\n"
"--\n"
"\n"
"Return a copy where all tab characters are expanded using spaces.\n"
"\n"
"If tabsize is not given, a tab size of 8 characters is assumed.");
#define UNICODE_EXPANDTABS_METHODDEF …
static PyObject *
unicode_expandtabs_impl(PyObject *self, int tabsize);
static PyObject *
unicode_expandtabs(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(unicode_find__doc__,
"find($self, sub[, start[, end]], /)\n"
"--\n"
"\n"
"Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].\n"
"\n"
"Optional arguments start and end are interpreted as in slice notation.\n"
"Return -1 on failure.");
#define UNICODE_FIND_METHODDEF …
static Py_ssize_t
unicode_find_impl(PyObject *str, PyObject *substr, Py_ssize_t start,
Py_ssize_t end);
static PyObject *
unicode_find(PyObject *str, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_index__doc__,
"index($self, sub[, start[, end]], /)\n"
"--\n"
"\n"
"Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].\n"
"\n"
"Optional arguments start and end are interpreted as in slice notation.\n"
"Raises ValueError when the substring is not found.");
#define UNICODE_INDEX_METHODDEF …
static Py_ssize_t
unicode_index_impl(PyObject *str, PyObject *substr, Py_ssize_t start,
Py_ssize_t end);
static PyObject *
unicode_index(PyObject *str, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_isascii__doc__,
"isascii($self, /)\n"
"--\n"
"\n"
"Return True if all characters in the string are ASCII, False otherwise.\n"
"\n"
"ASCII characters have code points in the range U+0000-U+007F.\n"
"Empty string is ASCII too.");
#define UNICODE_ISASCII_METHODDEF …
static PyObject *
unicode_isascii_impl(PyObject *self);
static PyObject *
unicode_isascii(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_islower__doc__,
"islower($self, /)\n"
"--\n"
"\n"
"Return True if the string is a lowercase string, False otherwise.\n"
"\n"
"A string is lowercase if all cased characters in the string are lowercase and\n"
"there is at least one cased character in the string.");
#define UNICODE_ISLOWER_METHODDEF …
static PyObject *
unicode_islower_impl(PyObject *self);
static PyObject *
unicode_islower(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_isupper__doc__,
"isupper($self, /)\n"
"--\n"
"\n"
"Return True if the string is an uppercase string, False otherwise.\n"
"\n"
"A string is uppercase if all cased characters in the string are uppercase and\n"
"there is at least one cased character in the string.");
#define UNICODE_ISUPPER_METHODDEF …
static PyObject *
unicode_isupper_impl(PyObject *self);
static PyObject *
unicode_isupper(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_istitle__doc__,
"istitle($self, /)\n"
"--\n"
"\n"
"Return True if the string is a title-cased string, False otherwise.\n"
"\n"
"In a title-cased string, upper- and title-case characters may only\n"
"follow uncased characters and lowercase characters only cased ones.");
#define UNICODE_ISTITLE_METHODDEF …
static PyObject *
unicode_istitle_impl(PyObject *self);
static PyObject *
unicode_istitle(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_isspace__doc__,
"isspace($self, /)\n"
"--\n"
"\n"
"Return True if the string is a whitespace string, False otherwise.\n"
"\n"
"A string is whitespace if all characters in the string are whitespace and there\n"
"is at least one character in the string.");
#define UNICODE_ISSPACE_METHODDEF …
static PyObject *
unicode_isspace_impl(PyObject *self);
static PyObject *
unicode_isspace(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_isalpha__doc__,
"isalpha($self, /)\n"
"--\n"
"\n"
"Return True if the string is an alphabetic string, False otherwise.\n"
"\n"
"A string is alphabetic if all characters in the string are alphabetic and there\n"
"is at least one character in the string.");
#define UNICODE_ISALPHA_METHODDEF …
static PyObject *
unicode_isalpha_impl(PyObject *self);
static PyObject *
unicode_isalpha(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_isalnum__doc__,
"isalnum($self, /)\n"
"--\n"
"\n"
"Return True if the string is an alpha-numeric string, False otherwise.\n"
"\n"
"A string is alpha-numeric if all characters in the string are alpha-numeric and\n"
"there is at least one character in the string.");
#define UNICODE_ISALNUM_METHODDEF …
static PyObject *
unicode_isalnum_impl(PyObject *self);
static PyObject *
unicode_isalnum(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_isdecimal__doc__,
"isdecimal($self, /)\n"
"--\n"
"\n"
"Return True if the string is a decimal string, False otherwise.\n"
"\n"
"A string is a decimal string if all characters in the string are decimal and\n"
"there is at least one character in the string.");
#define UNICODE_ISDECIMAL_METHODDEF …
static PyObject *
unicode_isdecimal_impl(PyObject *self);
static PyObject *
unicode_isdecimal(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_isdigit__doc__,
"isdigit($self, /)\n"
"--\n"
"\n"
"Return True if the string is a digit string, False otherwise.\n"
"\n"
"A string is a digit string if all characters in the string are digits and there\n"
"is at least one character in the string.");
#define UNICODE_ISDIGIT_METHODDEF …
static PyObject *
unicode_isdigit_impl(PyObject *self);
static PyObject *
unicode_isdigit(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_isnumeric__doc__,
"isnumeric($self, /)\n"
"--\n"
"\n"
"Return True if the string is a numeric string, False otherwise.\n"
"\n"
"A string is numeric if all characters in the string are numeric and there is at\n"
"least one character in the string.");
#define UNICODE_ISNUMERIC_METHODDEF …
static PyObject *
unicode_isnumeric_impl(PyObject *self);
static PyObject *
unicode_isnumeric(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_isidentifier__doc__,
"isidentifier($self, /)\n"
"--\n"
"\n"
"Return True if the string is a valid Python identifier, False otherwise.\n"
"\n"
"Call keyword.iskeyword(s) to test whether string s is a reserved identifier,\n"
"such as \"def\" or \"class\".");
#define UNICODE_ISIDENTIFIER_METHODDEF …
static PyObject *
unicode_isidentifier_impl(PyObject *self);
static PyObject *
unicode_isidentifier(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_isprintable__doc__,
"isprintable($self, /)\n"
"--\n"
"\n"
"Return True if the string is printable, False otherwise.\n"
"\n"
"A string is printable if all of its characters are considered printable in\n"
"repr() or if it is empty.");
#define UNICODE_ISPRINTABLE_METHODDEF …
static PyObject *
unicode_isprintable_impl(PyObject *self);
static PyObject *
unicode_isprintable(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_join__doc__,
"join($self, iterable, /)\n"
"--\n"
"\n"
"Concatenate any number of strings.\n"
"\n"
"The string whose method is called is inserted in between each given string.\n"
"The result is returned as a new string.\n"
"\n"
"Example: \'.\'.join([\'ab\', \'pq\', \'rs\']) -> \'ab.pq.rs\'");
#define UNICODE_JOIN_METHODDEF …
PyDoc_STRVAR(unicode_ljust__doc__,
"ljust($self, width, fillchar=\' \', /)\n"
"--\n"
"\n"
"Return a left-justified string of length width.\n"
"\n"
"Padding is done using the specified fill character (default is a space).");
#define UNICODE_LJUST_METHODDEF …
static PyObject *
unicode_ljust_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar);
static PyObject *
unicode_ljust(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_lower__doc__,
"lower($self, /)\n"
"--\n"
"\n"
"Return a copy of the string converted to lowercase.");
#define UNICODE_LOWER_METHODDEF …
static PyObject *
unicode_lower_impl(PyObject *self);
static PyObject *
unicode_lower(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_strip__doc__,
"strip($self, chars=None, /)\n"
"--\n"
"\n"
"Return a copy of the string with leading and trailing whitespace removed.\n"
"\n"
"If chars is given and not None, remove characters in chars instead.");
#define UNICODE_STRIP_METHODDEF …
static PyObject *
unicode_strip_impl(PyObject *self, PyObject *chars);
static PyObject *
unicode_strip(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_lstrip__doc__,
"lstrip($self, chars=None, /)\n"
"--\n"
"\n"
"Return a copy of the string with leading whitespace removed.\n"
"\n"
"If chars is given and not None, remove characters in chars instead.");
#define UNICODE_LSTRIP_METHODDEF …
static PyObject *
unicode_lstrip_impl(PyObject *self, PyObject *chars);
static PyObject *
unicode_lstrip(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_rstrip__doc__,
"rstrip($self, chars=None, /)\n"
"--\n"
"\n"
"Return a copy of the string with trailing whitespace removed.\n"
"\n"
"If chars is given and not None, remove characters in chars instead.");
#define UNICODE_RSTRIP_METHODDEF …
static PyObject *
unicode_rstrip_impl(PyObject *self, PyObject *chars);
static PyObject *
unicode_rstrip(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_replace__doc__,
"replace($self, old, new, /, count=-1)\n"
"--\n"
"\n"
"Return a copy with all occurrences of substring old replaced by new.\n"
"\n"
" count\n"
" Maximum number of occurrences to replace.\n"
" -1 (the default value) means replace all occurrences.\n"
"\n"
"If the optional argument count is given, only the first count occurrences are\n"
"replaced.");
#define UNICODE_REPLACE_METHODDEF …
static PyObject *
unicode_replace_impl(PyObject *self, PyObject *old, PyObject *new,
Py_ssize_t count);
static PyObject *
unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(unicode_removeprefix__doc__,
"removeprefix($self, prefix, /)\n"
"--\n"
"\n"
"Return a str with the given prefix string removed if present.\n"
"\n"
"If the string starts with the prefix string, return string[len(prefix):].\n"
"Otherwise, return a copy of the original string.");
#define UNICODE_REMOVEPREFIX_METHODDEF …
static PyObject *
unicode_removeprefix_impl(PyObject *self, PyObject *prefix);
static PyObject *
unicode_removeprefix(PyObject *self, PyObject *arg)
{ … }
PyDoc_STRVAR(unicode_removesuffix__doc__,
"removesuffix($self, suffix, /)\n"
"--\n"
"\n"
"Return a str with the given suffix string removed if present.\n"
"\n"
"If the string ends with the suffix string and that suffix is not empty,\n"
"return string[:-len(suffix)]. Otherwise, return a copy of the original\n"
"string.");
#define UNICODE_REMOVESUFFIX_METHODDEF …
static PyObject *
unicode_removesuffix_impl(PyObject *self, PyObject *suffix);
static PyObject *
unicode_removesuffix(PyObject *self, PyObject *arg)
{ … }
PyDoc_STRVAR(unicode_rfind__doc__,
"rfind($self, sub[, start[, end]], /)\n"
"--\n"
"\n"
"Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].\n"
"\n"
"Optional arguments start and end are interpreted as in slice notation.\n"
"Return -1 on failure.");
#define UNICODE_RFIND_METHODDEF …
static Py_ssize_t
unicode_rfind_impl(PyObject *str, PyObject *substr, Py_ssize_t start,
Py_ssize_t end);
static PyObject *
unicode_rfind(PyObject *str, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_rindex__doc__,
"rindex($self, sub[, start[, end]], /)\n"
"--\n"
"\n"
"Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].\n"
"\n"
"Optional arguments start and end are interpreted as in slice notation.\n"
"Raises ValueError when the substring is not found.");
#define UNICODE_RINDEX_METHODDEF …
static Py_ssize_t
unicode_rindex_impl(PyObject *str, PyObject *substr, Py_ssize_t start,
Py_ssize_t end);
static PyObject *
unicode_rindex(PyObject *str, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_rjust__doc__,
"rjust($self, width, fillchar=\' \', /)\n"
"--\n"
"\n"
"Return a right-justified string of length width.\n"
"\n"
"Padding is done using the specified fill character (default is a space).");
#define UNICODE_RJUST_METHODDEF …
static PyObject *
unicode_rjust_impl(PyObject *self, Py_ssize_t width, Py_UCS4 fillchar);
static PyObject *
unicode_rjust(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_split__doc__,
"split($self, /, sep=None, maxsplit=-1)\n"
"--\n"
"\n"
"Return a list of the substrings in the string, using sep as the separator string.\n"
"\n"
" sep\n"
" The separator used to split the string.\n"
"\n"
" When set to None (the default value), will split on any whitespace\n"
" character (including \\n \\r \\t \\f and spaces) and will discard\n"
" empty strings from the result.\n"
" maxsplit\n"
" Maximum number of splits.\n"
" -1 (the default value) means no limit.\n"
"\n"
"Splitting starts at the front of the string and works to the end.\n"
"\n"
"Note, str.split() is mainly useful for data that has been intentionally\n"
"delimited. With natural text that includes punctuation, consider using\n"
"the regular expression module.");
#define UNICODE_SPLIT_METHODDEF …
static PyObject *
unicode_split_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit);
static PyObject *
unicode_split(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(unicode_partition__doc__,
"partition($self, sep, /)\n"
"--\n"
"\n"
"Partition the string into three parts using the given separator.\n"
"\n"
"This will search for the separator in the string. If the separator is found,\n"
"returns a 3-tuple containing the part before the separator, the separator\n"
"itself, and the part after it.\n"
"\n"
"If the separator is not found, returns a 3-tuple containing the original string\n"
"and two empty strings.");
#define UNICODE_PARTITION_METHODDEF …
PyDoc_STRVAR(unicode_rpartition__doc__,
"rpartition($self, sep, /)\n"
"--\n"
"\n"
"Partition the string into three parts using the given separator.\n"
"\n"
"This will search for the separator in the string, starting at the end. If\n"
"the separator is found, returns a 3-tuple containing the part before the\n"
"separator, the separator itself, and the part after it.\n"
"\n"
"If the separator is not found, returns a 3-tuple containing two empty strings\n"
"and the original string.");
#define UNICODE_RPARTITION_METHODDEF …
PyDoc_STRVAR(unicode_rsplit__doc__,
"rsplit($self, /, sep=None, maxsplit=-1)\n"
"--\n"
"\n"
"Return a list of the substrings in the string, using sep as the separator string.\n"
"\n"
" sep\n"
" The separator used to split the string.\n"
"\n"
" When set to None (the default value), will split on any whitespace\n"
" character (including \\n \\r \\t \\f and spaces) and will discard\n"
" empty strings from the result.\n"
" maxsplit\n"
" Maximum number of splits.\n"
" -1 (the default value) means no limit.\n"
"\n"
"Splitting starts at the end of the string and works to the front.");
#define UNICODE_RSPLIT_METHODDEF …
static PyObject *
unicode_rsplit_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit);
static PyObject *
unicode_rsplit(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(unicode_splitlines__doc__,
"splitlines($self, /, keepends=False)\n"
"--\n"
"\n"
"Return a list of the lines in the string, breaking at line boundaries.\n"
"\n"
"Line breaks are not included in the resulting list unless keepends is given and\n"
"true.");
#define UNICODE_SPLITLINES_METHODDEF …
static PyObject *
unicode_splitlines_impl(PyObject *self, int keepends);
static PyObject *
unicode_splitlines(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{ … }
PyDoc_STRVAR(unicode_swapcase__doc__,
"swapcase($self, /)\n"
"--\n"
"\n"
"Convert uppercase characters to lowercase and lowercase characters to uppercase.");
#define UNICODE_SWAPCASE_METHODDEF …
static PyObject *
unicode_swapcase_impl(PyObject *self);
static PyObject *
unicode_swapcase(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_maketrans__doc__,
"maketrans(x, y=<unrepresentable>, z=<unrepresentable>, /)\n"
"--\n"
"\n"
"Return a translation table usable for str.translate().\n"
"\n"
"If there is only one argument, it must be a dictionary mapping Unicode\n"
"ordinals (integers) or characters to Unicode ordinals, strings or None.\n"
"Character keys will be then converted to ordinals.\n"
"If there are two arguments, they must be strings of equal length, and\n"
"in the resulting dictionary, each character in x will be mapped to the\n"
"character at the same position in y. If there is a third argument, it\n"
"must be a string, whose characters will be mapped to None in the result.");
#define UNICODE_MAKETRANS_METHODDEF …
static PyObject *
unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z);
static PyObject *
unicode_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_translate__doc__,
"translate($self, table, /)\n"
"--\n"
"\n"
"Replace each character in the string using the given translation table.\n"
"\n"
" table\n"
" Translation table, which must be a mapping of Unicode ordinals to\n"
" Unicode ordinals, strings, or None.\n"
"\n"
"The table must implement lookup/indexing via __getitem__, for instance a\n"
"dictionary or list. If this operation raises LookupError, the character is\n"
"left untouched. Characters mapped to None are deleted.");
#define UNICODE_TRANSLATE_METHODDEF …
PyDoc_STRVAR(unicode_upper__doc__,
"upper($self, /)\n"
"--\n"
"\n"
"Return a copy of the string converted to uppercase.");
#define UNICODE_UPPER_METHODDEF …
static PyObject *
unicode_upper_impl(PyObject *self);
static PyObject *
unicode_upper(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(unicode_zfill__doc__,
"zfill($self, width, /)\n"
"--\n"
"\n"
"Pad a numeric string with zeros on the left, to fill a field of the given width.\n"
"\n"
"The string is never truncated.");
#define UNICODE_ZFILL_METHODDEF …
static PyObject *
unicode_zfill_impl(PyObject *self, Py_ssize_t width);
static PyObject *
unicode_zfill(PyObject *self, PyObject *arg)
{ … }
PyDoc_STRVAR(unicode_startswith__doc__,
"startswith($self, prefix[, start[, end]], /)\n"
"--\n"
"\n"
"Return True if the string starts with the specified prefix, False otherwise.\n"
"\n"
" prefix\n"
" A string or a tuple of strings to try.\n"
" start\n"
" Optional start position. Default: start of the string.\n"
" end\n"
" Optional stop position. Default: end of the string.");
#define UNICODE_STARTSWITH_METHODDEF …
static PyObject *
unicode_startswith_impl(PyObject *self, PyObject *subobj, Py_ssize_t start,
Py_ssize_t end);
static PyObject *
unicode_startswith(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode_endswith__doc__,
"endswith($self, suffix[, start[, end]], /)\n"
"--\n"
"\n"
"Return True if the string ends with the specified suffix, False otherwise.\n"
"\n"
" suffix\n"
" A string or a tuple of strings to try.\n"
" start\n"
" Optional start position. Default: start of the string.\n"
" end\n"
" Optional stop position. Default: end of the string.");
#define UNICODE_ENDSWITH_METHODDEF …
static PyObject *
unicode_endswith_impl(PyObject *self, PyObject *subobj, Py_ssize_t start,
Py_ssize_t end);
static PyObject *
unicode_endswith(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(unicode___format____doc__,
"__format__($self, format_spec, /)\n"
"--\n"
"\n"
"Return a formatted version of the string as described by format_spec.");
#define UNICODE___FORMAT___METHODDEF …
static PyObject *
unicode___format___impl(PyObject *self, PyObject *format_spec);
static PyObject *
unicode___format__(PyObject *self, PyObject *arg)
{ … }
PyDoc_STRVAR(unicode_sizeof__doc__,
"__sizeof__($self, /)\n"
"--\n"
"\n"
"Return the size of the string in memory, in bytes.");
#define UNICODE_SIZEOF_METHODDEF …
static PyObject *
unicode_sizeof_impl(PyObject *self);
static PyObject *
unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored))
{ … }
static PyObject *
unicode_new_impl(PyTypeObject *type, PyObject *x, const char *encoding,
const char *errors);
static PyObject *
unicode_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{ … }