Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
be1399e3
Kaydet (Commit)
be1399e3
authored
Ock 31, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix indentation; looks like all I managed to do the first time is make things uglier
üst
d17fec74
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
75 deletions
+75
-75
unicodeobject.c
Objects/unicodeobject.c
+75
-75
No files found.
Objects/unicodeobject.c
Dosyayı görüntüle @
be1399e3
...
@@ -12,8 +12,8 @@ Copyright (c) Corporation for National Research Initiatives.
...
@@ -12,8 +12,8 @@ Copyright (c) Corporation for National Research Initiatives.
--------------------------------------------------------------------
--------------------------------------------------------------------
The original string type implementation is:
The original string type implementation is:
Copyright (c) 1999 by Secret Labs AB
Copyright (c) 1999 by Secret Labs AB
Copyright (c) 1999 by Fredrik Lundh
Copyright (c) 1999 by Fredrik Lundh
By obtaining, using, and/or copying this software and/or its
By obtaining, using, and/or copying this software and/or its
associated documentation, you agree that you have read, understood,
associated documentation, you agree that you have read, understood,
...
@@ -225,7 +225,7 @@ Py_LOCAL_INLINE(int) unicode_member(Py_UNICODE chr, Py_UNICODE* set, Py_ssize_t
...
@@ -225,7 +225,7 @@ Py_LOCAL_INLINE(int) unicode_member(Py_UNICODE chr, Py_UNICODE* set, Py_ssize_t
return 0;
return 0;
}
}
#define BLOOM_MEMBER(mask, chr, set, setlen)\
#define BLOOM_MEMBER(mask, chr, set, setlen)
\
BLOOM(mask, chr) && unicode_member(chr, set, setlen)
BLOOM(mask, chr) && unicode_member(chr, set, setlen)
/* --- Unicode Object ----------------------------------------------------- */
/* --- Unicode Object ----------------------------------------------------- */
...
@@ -691,11 +691,11 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
...
@@ -691,11 +691,11 @@ PyUnicode_FromFormatV(const char *format, va_list vargs)
s++; if(!*s)break;
s++; if(!*s)break;
s++;
s++;
} else {
} else {
#ifdef Py_UNICODE_WIDE
#ifdef Py_UNICODE_WIDE
n++;
n++;
#else
#else
n+=2;
n+=2;
#endif
#endif
s++; if(!*s)break;
s++; if(!*s)break;
s++; if(!*s)break;
s++; if(!*s)break;
s++; if(!*s)break;
s++; if(!*s)break;
...
@@ -1636,7 +1636,7 @@ PyObject *PyUnicode_DecodeUTF7Stateful(const char *s,
...
@@ -1636,7 +1636,7 @@ PyObject *PyUnicode_DecodeUTF7Stateful(const char *s,
Py_XDECREF(exc);
Py_XDECREF(exc);
return (PyObject *)unicode;
return (PyObject *)unicode;
onError:
onError:
Py_XDECREF(errorHandler);
Py_XDECREF(errorHandler);
Py_XDECREF(exc);
Py_XDECREF(exc);
Py_DECREF(unicode);
Py_DECREF(unicode);
...
@@ -1958,7 +1958,7 @@ PyObject *PyUnicode_DecodeUTF8Stateful(const char *s,
...
@@ -1958,7 +1958,7 @@ PyObject *PyUnicode_DecodeUTF8Stateful(const char *s,
Py_XDECREF(exc);
Py_XDECREF(exc);
return (PyObject *)unicode;
return (PyObject *)unicode;
onError:
onError:
Py_XDECREF(errorHandler);
Py_XDECREF(errorHandler);
Py_XDECREF(exc);
Py_XDECREF(exc);
Py_DECREF(unicode);
Py_DECREF(unicode);
...
@@ -2039,7 +2039,7 @@ PyUnicode_EncodeUTF8(const Py_UNICODE *s,
...
@@ -2039,7 +2039,7 @@ PyUnicode_EncodeUTF8(const Py_UNICODE *s,
*p++ = (char)(0x80 | (ch & 0x3f));
*p++ = (char)(0x80 | (ch & 0x3f));
continue;
continue;
}
}
encodeUCS4:
encodeUCS4:
/* Encode UCS4 Unicode ordinals */
/* Encode UCS4 Unicode ordinals */
*p++ = (char)(0xf0 | (ch >> 18));
*p++ = (char)(0xf0 | (ch >> 18));
*p++ = (char)(0x80 | ((ch >> 12) & 0x3f));
*p++ = (char)(0x80 | ((ch >> 12) & 0x3f));
...
@@ -2242,7 +2242,7 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
...
@@ -2242,7 +2242,7 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
Py_XDECREF(exc);
Py_XDECREF(exc);
return (PyObject *)unicode;
return (PyObject *)unicode;
onError:
onError:
Py_DECREF(unicode);
Py_DECREF(unicode);
Py_XDECREF(errorHandler);
Py_XDECREF(errorHandler);
Py_XDECREF(exc);
Py_XDECREF(exc);
...
@@ -2516,7 +2516,7 @@ PyUnicode_DecodeUTF16Stateful(const char *s,
...
@@ -2516,7 +2516,7 @@ PyUnicode_DecodeUTF16Stateful(const char *s,
Py_XDECREF(exc);
Py_XDECREF(exc);
return (PyObject *)unicode;
return (PyObject *)unicode;
onError:
onError:
Py_DECREF(unicode);
Py_DECREF(unicode);
Py_XDECREF(errorHandler);
Py_XDECREF(errorHandler);
Py_XDECREF(exc);
Py_XDECREF(exc);
...
@@ -2844,7 +2844,7 @@ PyObject *PyUnicode_DecodeUnicodeEscape(const char *s,
...
@@ -2844,7 +2844,7 @@ PyObject *PyUnicode_DecodeUnicodeEscape(const char *s,
Py_XDECREF(exc);
Py_XDECREF(exc);
return (PyObject *)v;
return (PyObject *)v;
ucnhashError:
ucnhashError:
PyErr_SetString(
PyErr_SetString(
PyExc_UnicodeError,
PyExc_UnicodeError,
"\\N escapes not supported (can't load unicodedata module)"
"\\N escapes not supported (can't load unicodedata module)"
...
@@ -2854,7 +2854,7 @@ ucnhashError:
...
@@ -2854,7 +2854,7 @@ ucnhashError:
Py_XDECREF(exc);
Py_XDECREF(exc);
return NULL;
return NULL;
onError:
onError:
Py_XDECREF(v);
Py_XDECREF(v);
Py_XDECREF(errorHandler);
Py_XDECREF(errorHandler);
Py_XDECREF(exc);
Py_XDECREF(exc);
...
@@ -3297,9 +3297,9 @@ PyObject *_PyUnicode_DecodeUnicodeInternal(const char *s,
...
@@ -3297,9 +3297,9 @@ PyObject *_PyUnicode_DecodeUnicodeInternal(const char *s,
/* We have to sanity check the raw data, otherwise doom looms for
/* We have to sanity check the raw data, otherwise doom looms for
some malformed UCS-4 data. */
some malformed UCS-4 data. */
if (
if (
#ifdef Py_UNICODE_WIDE
#ifdef Py_UNICODE_WIDE
*p > unimax || *p < 0 ||
*p > unimax || *p < 0 ||
#endif
#endif
end-s < Py_UNICODE_SIZE
end-s < Py_UNICODE_SIZE
)
)
{
{
...
@@ -3587,9 +3587,9 @@ static PyObject *unicode_encode_ucs1(const Py_UNICODE *p,
...
@@ -3587,9 +3587,9 @@ static PyObject *unicode_encode_ucs1(const Py_UNICODE *p,
collstart-startp, collend-startp, &newpos);
collstart-startp, collend-startp, &newpos);
if (repunicode == NULL)
if (repunicode == NULL)
goto onError;
goto onError;
/* need more space? (at least enough for what w
e
/* need more space? (at least enough for what we have+th
e
have+the replacement+the rest of the string, s
o
replacement+the rest of the string, so we won't have t
o
we won't have to
check space for encodable characters) */
check space for encodable characters) */
respos = str-PyString_AS_STRING(res);
respos = str-PyString_AS_STRING(res);
repsize = PyUnicode_GET_SIZE(repunicode);
repsize = PyUnicode_GET_SIZE(repunicode);
requiredsize = respos+repsize+(endp-collend);
requiredsize = respos+repsize+(endp-collend);
...
@@ -4213,9 +4213,9 @@ PyUnicode_BuildEncodingMap(PyObject* string)
...
@@ -4213,9 +4213,9 @@ PyUnicode_BuildEncodingMap(PyObject* string)
for (i = 1; i < 256; i++) {
for (i = 1; i < 256; i++) {
int l1, l2;
int l1, l2;
if (decode[i] == 0
if (decode[i] == 0
#ifdef Py_UNICODE_WIDE
#ifdef Py_UNICODE_WIDE
|| decode[i] > 0xFFFF
|| decode[i] > 0xFFFF
#endif
#endif
) {
) {
need_dict = 1;
need_dict = 1;
break;
break;
...
@@ -4786,8 +4786,8 @@ int charmaptranslate_lookup(Py_UNICODE c, PyObject *mapping, PyObject **result)
...
@@ -4786,8 +4786,8 @@ int charmaptranslate_lookup(Py_UNICODE c, PyObject *mapping, PyObject **result)
}
}
}
}
/* ensure that *outobj is at least requiredsize characters long,
/* ensure that *outobj is at least requiredsize characters long,
if not reallocate and adjust various state variables.
if not reallocate and adjust various state variables.
Return 0 on success, -1 on error */
Return 0 on success, -1 on error */
static
static
int charmaptranslate_makespace(PyObject **outobj, Py_UNICODE **outp,
int charmaptranslate_makespace(PyObject **outobj, Py_UNICODE **outp,
Py_ssize_t requiredsize)
Py_ssize_t requiredsize)
...
@@ -6079,7 +6079,7 @@ PyObject *replace(PyUnicodeObject *self,
...
@@ -6079,7 +6079,7 @@ PyObject *replace(PyUnicodeObject *self,
}
}
return (PyObject *) u;
return (PyObject *) u;
nothing:
nothing:
/* nothing to replace; return original string (when possible) */
/* nothing to replace; return original string (when possible) */
if (PyUnicode_CheckExact(self)) {
if (PyUnicode_CheckExact(self)) {
Py_INCREF(self);
Py_INCREF(self);
...
@@ -6091,7 +6091,7 @@ nothing:
...
@@ -6091,7 +6091,7 @@ nothing:
/* --- Unicode Object Methods --------------------------------------------- */
/* --- Unicode Object Methods --------------------------------------------- */
PyDoc_STRVAR(title__doc__,
PyDoc_STRVAR(title__doc__,
"S.title() -> unicode\n\
"S.title() -> unicode\n\
\n\
\n\
Return a titlecased version of S, i.e. words start with title case\n\
Return a titlecased version of S, i.e. words start with title case\n\
characters, all remaining cased characters have lower case.");
characters, all remaining cased characters have lower case.");
...
@@ -6103,7 +6103,7 @@ unicode_title(PyUnicodeObject *self)
...
@@ -6103,7 +6103,7 @@ unicode_title(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(capitalize__doc__,
PyDoc_STRVAR(capitalize__doc__,
"S.capitalize() -> unicode\n\
"S.capitalize() -> unicode\n\
\n\
\n\
Return a capitalized version of S, i.e. make the first character\n\
Return a capitalized version of S, i.e. make the first character\n\
have upper case.");
have upper case.");
...
@@ -6116,7 +6116,7 @@ unicode_capitalize(PyUnicodeObject *self)
...
@@ -6116,7 +6116,7 @@ unicode_capitalize(PyUnicodeObject *self)
#if 0
#if 0
PyDoc_STRVAR(capwords__doc__,
PyDoc_STRVAR(capwords__doc__,
"S.capwords() -> unicode\n\
"S.capwords() -> unicode\n\
\n\
\n\
Apply .capitalize() to all words in S and return the result with\n\
Apply .capitalize() to all words in S and return the result with\n\
normalized whitespace (all whitespace strings are replaced by ' ').");
normalized whitespace (all whitespace strings are replaced by ' ').");
...
@@ -6146,7 +6146,7 @@ unicode_capwords(PyUnicodeObject *self)
...
@@ -6146,7 +6146,7 @@ unicode_capwords(PyUnicodeObject *self)
/* Join the words to form a new string */
/* Join the words to form a new string */
item = PyUnicode_Join(NULL, list);
item = PyUnicode_Join(NULL, list);
onError:
onError:
Py_DECREF(list);
Py_DECREF(list);
return (PyObject *)item;
return (PyObject *)item;
}
}
...
@@ -6180,7 +6180,7 @@ convert_uc(PyObject *obj, void *addr)
...
@@ -6180,7 +6180,7 @@ convert_uc(PyObject *obj, void *addr)
}
}
PyDoc_STRVAR(center__doc__,
PyDoc_STRVAR(center__doc__,
"S.center(width[, fillchar]) -> unicode\n\
"S.center(width[, fillchar]) -> unicode\n\
\n\
\n\
Return S centered in a Unicode string of length width. Padding is\n\
Return S centered in a Unicode string of length width. Padding is\n\
done using the specified fill character (default is a space)");
done using the specified fill character (default is a space)");
...
@@ -6313,7 +6313,7 @@ int PyUnicode_Compare(PyObject *left,
...
@@ -6313,7 +6313,7 @@ int PyUnicode_Compare(PyObject *left,
Py_DECREF(v);
Py_DECREF(v);
return result;
return result;
onError:
onError:
Py_XDECREF(u);
Py_XDECREF(u);
Py_XDECREF(v);
Py_XDECREF(v);
return -1;
return -1;
...
@@ -6459,14 +6459,14 @@ PyObject *PyUnicode_Concat(PyObject *left,
...
@@ -6459,14 +6459,14 @@ PyObject *PyUnicode_Concat(PyObject *left,
Py_DECREF(v);
Py_DECREF(v);
return (PyObject *)w;
return (PyObject *)w;
onError:
onError:
Py_XDECREF(u);
Py_XDECREF(u);
Py_XDECREF(v);
Py_XDECREF(v);
return NULL;
return NULL;
}
}
PyDoc_STRVAR(count__doc__,
PyDoc_STRVAR(count__doc__,
"S.count(sub[, start[, end]]) -> int\n\
"S.count(sub[, start[, end]]) -> int\n\
\n\
\n\
Return the number of non-overlapping occurrences of substring sub in\n\
Return the number of non-overlapping occurrences of substring sub in\n\
Unicode string S[start:end]. Optional arguments start and end are\n\
Unicode string S[start:end]. Optional arguments start and end are\n\
...
@@ -6502,7 +6502,7 @@ unicode_count(PyUnicodeObject *self, PyObject *args)
...
@@ -6502,7 +6502,7 @@ unicode_count(PyUnicodeObject *self, PyObject *args)
}
}
PyDoc_STRVAR(encode__doc__,
PyDoc_STRVAR(encode__doc__,
"S.encode([encoding[,errors]]) -> string or unicode\n\
"S.encode([encoding[,errors]]) -> string or unicode\n\
\n\
\n\
Encodes S using the codec registered for encoding. encoding defaults\n\
Encodes S using the codec registered for encoding. encoding defaults\n\
to the default encoding. errors may be given to set a different error\n\
to the default encoding. errors may be given to set a different error\n\
...
@@ -6538,7 +6538,7 @@ unicode_encode(PyUnicodeObject *self, PyObject *args)
...
@@ -6538,7 +6538,7 @@ unicode_encode(PyUnicodeObject *self, PyObject *args)
}
}
PyDoc_STRVAR(decode__doc__,
PyDoc_STRVAR(decode__doc__,
"S.decode([encoding[,errors]]) -> string or unicode\n\
"S.decode([encoding[,errors]]) -> string or unicode\n\
\n\
\n\
Decodes S using the codec registered for encoding. encoding defaults\n\
Decodes S using the codec registered for encoding. encoding defaults\n\
to the default encoding. errors may be given to set a different error\n\
to the default encoding. errors may be given to set a different error\n\
...
@@ -6574,7 +6574,7 @@ unicode_decode(PyUnicodeObject *self, PyObject *args)
...
@@ -6574,7 +6574,7 @@ unicode_decode(PyUnicodeObject *self, PyObject *args)
}
}
PyDoc_STRVAR(expandtabs__doc__,
PyDoc_STRVAR(expandtabs__doc__,
"S.expandtabs([tabsize]) -> unicode\n\
"S.expandtabs([tabsize]) -> unicode\n\
\n\
\n\
Return a copy of S where all tab characters are expanded using spaces.\n\
Return a copy of S where all tab characters are expanded using spaces.\n\
If tabsize is not given, a tab size of 8 characters is assumed.");
If tabsize is not given, a tab size of 8 characters is assumed.");
...
@@ -6661,7 +6661,7 @@ unicode_expandtabs(PyUnicodeObject *self, PyObject *args)
...
@@ -6661,7 +6661,7 @@ unicode_expandtabs(PyUnicodeObject *self, PyObject *args)
}
}
PyDoc_STRVAR(find__doc__,
PyDoc_STRVAR(find__doc__,
"S.find(sub [,start [,end]]) -> int\n\
"S.find(sub [,start [,end]]) -> int\n\
\n\
\n\
Return the lowest index in S where substring sub is found,\n\
Return the lowest index in S where substring sub is found,\n\
such that sub is contained within s[start:end]. Optional\n\
such that sub is contained within s[start:end]. Optional\n\
...
@@ -6730,7 +6730,7 @@ unicode_hash(PyUnicodeObject *self)
...
@@ -6730,7 +6730,7 @@ unicode_hash(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(index__doc__,
PyDoc_STRVAR(index__doc__,
"S.index(sub [,start [,end]]) -> int\n\
"S.index(sub [,start [,end]]) -> int\n\
\n\
\n\
Like S.find() but raise ValueError when the substring is not found.");
Like S.find() but raise ValueError when the substring is not found.");
...
@@ -6762,7 +6762,7 @@ unicode_index(PyUnicodeObject *self, PyObject *args)
...
@@ -6762,7 +6762,7 @@ unicode_index(PyUnicodeObject *self, PyObject *args)
}
}
PyDoc_STRVAR(islower__doc__,
PyDoc_STRVAR(islower__doc__,
"S.islower() -> bool\n\
"S.islower() -> bool\n\
\n\
\n\
Return True if all cased characters in S are lowercase and there is\n\
Return True if all cased characters in S are lowercase and there is\n\
at least one cased character in S, False otherwise.");
at least one cased character in S, False otherwise.");
...
@@ -6796,7 +6796,7 @@ unicode_islower(PyUnicodeObject *self)
...
@@ -6796,7 +6796,7 @@ unicode_islower(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(isupper__doc__,
PyDoc_STRVAR(isupper__doc__,
"S.isupper() -> bool\n\
"S.isupper() -> bool\n\
\n\
\n\
Return True if all cased characters in S are uppercase and there is\n\
Return True if all cased characters in S are uppercase and there is\n\
at least one cased character in S, False otherwise.");
at least one cased character in S, False otherwise.");
...
@@ -6830,7 +6830,7 @@ unicode_isupper(PyUnicodeObject *self)
...
@@ -6830,7 +6830,7 @@ unicode_isupper(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(istitle__doc__,
PyDoc_STRVAR(istitle__doc__,
"S.istitle() -> bool\n\
"S.istitle() -> bool\n\
\n\
\n\
Return True if S is a titlecased string and there is at least one\n\
Return True if S is a titlecased string and there is at least one\n\
character in S, i.e. upper- and titlecase characters may only\n\
character in S, i.e. upper- and titlecase characters may only\n\
...
@@ -6878,7 +6878,7 @@ unicode_istitle(PyUnicodeObject *self)
...
@@ -6878,7 +6878,7 @@ unicode_istitle(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(isspace__doc__,
PyDoc_STRVAR(isspace__doc__,
"S.isspace() -> bool\n\
"S.isspace() -> bool\n\
\n\
\n\
Return True if all characters in S are whitespace\n\
Return True if all characters in S are whitespace\n\
and there is at least one character in S, False otherwise.");
and there is at least one character in S, False otherwise.");
...
@@ -6907,7 +6907,7 @@ unicode_isspace(PyUnicodeObject *self)
...
@@ -6907,7 +6907,7 @@ unicode_isspace(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(isalpha__doc__,
PyDoc_STRVAR(isalpha__doc__,
"S.isalpha() -> bool\n\
"S.isalpha() -> bool\n\
\n\
\n\
Return True if all characters in S are alphabetic\n\
Return True if all characters in S are alphabetic\n\
and there is at least one character in S, False otherwise.");
and there is at least one character in S, False otherwise.");
...
@@ -6936,7 +6936,7 @@ unicode_isalpha(PyUnicodeObject *self)
...
@@ -6936,7 +6936,7 @@ unicode_isalpha(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(isalnum__doc__,
PyDoc_STRVAR(isalnum__doc__,
"S.isalnum() -> bool\n\
"S.isalnum() -> bool\n\
\n\
\n\
Return True if all characters in S are alphanumeric\n\
Return True if all characters in S are alphanumeric\n\
and there is at least one character in S, False otherwise.");
and there is at least one character in S, False otherwise.");
...
@@ -6965,7 +6965,7 @@ unicode_isalnum(PyUnicodeObject *self)
...
@@ -6965,7 +6965,7 @@ unicode_isalnum(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(isdecimal__doc__,
PyDoc_STRVAR(isdecimal__doc__,
"S.isdecimal() -> bool\n\
"S.isdecimal() -> bool\n\
\n\
\n\
Return True if there are only decimal characters in S,\n\
Return True if there are only decimal characters in S,\n\
False otherwise.");
False otherwise.");
...
@@ -6994,7 +6994,7 @@ unicode_isdecimal(PyUnicodeObject *self)
...
@@ -6994,7 +6994,7 @@ unicode_isdecimal(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(isdigit__doc__,
PyDoc_STRVAR(isdigit__doc__,
"S.isdigit() -> bool\n\
"S.isdigit() -> bool\n\
\n\
\n\
Return True if all characters in S are digits\n\
Return True if all characters in S are digits\n\
and there is at least one character in S, False otherwise.");
and there is at least one character in S, False otherwise.");
...
@@ -7023,7 +7023,7 @@ unicode_isdigit(PyUnicodeObject *self)
...
@@ -7023,7 +7023,7 @@ unicode_isdigit(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(isnumeric__doc__,
PyDoc_STRVAR(isnumeric__doc__,
"S.isnumeric() -> bool\n\
"S.isnumeric() -> bool\n\
\n\
\n\
Return True if there are only numeric characters in S,\n\
Return True if there are only numeric characters in S,\n\
False otherwise.");
False otherwise.");
...
@@ -7052,7 +7052,7 @@ unicode_isnumeric(PyUnicodeObject *self)
...
@@ -7052,7 +7052,7 @@ unicode_isnumeric(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(join__doc__,
PyDoc_STRVAR(join__doc__,
"S.join(sequence) -> unicode\n\
"S.join(sequence) -> unicode\n\
\n\
\n\
Return a string which is the concatenation of the strings in the\n\
Return a string which is the concatenation of the strings in the\n\
sequence. The separator between elements is S.");
sequence. The separator between elements is S.");
...
@@ -7070,7 +7070,7 @@ unicode_length(PyUnicodeObject *self)
...
@@ -7070,7 +7070,7 @@ unicode_length(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(ljust__doc__,
PyDoc_STRVAR(ljust__doc__,
"S.ljust(width[, fillchar]) -> int\n\
"S.ljust(width[, fillchar]) -> int\n\
\n\
\n\
Return S left-justified in a Unicode string of length width. Padding is\n\
Return S left-justified in a Unicode string of length width. Padding is\n\
done using the specified fill character (default is a space).");
done using the specified fill character (default is a space).");
...
@@ -7093,7 +7093,7 @@ unicode_ljust(PyUnicodeObject *self, PyObject *args)
...
@@ -7093,7 +7093,7 @@ unicode_ljust(PyUnicodeObject *self, PyObject *args)
}
}
PyDoc_STRVAR(lower__doc__,
PyDoc_STRVAR(lower__doc__,
"S.lower() -> unicode\n\
"S.lower() -> unicode\n\
\n\
\n\
Return a copy of the string S converted to lowercase.");
Return a copy of the string S converted to lowercase.");
...
@@ -7211,7 +7211,7 @@ do_argstrip(PyUnicodeObject *self, int striptype, PyObject *args)
...
@@ -7211,7 +7211,7 @@ do_argstrip(PyUnicodeObject *self, int striptype, PyObject *args)
PyDoc_STRVAR(strip__doc__,
PyDoc_STRVAR(strip__doc__,
"S.strip([chars]) -> unicode\n\
"S.strip([chars]) -> unicode\n\
\n\
\n\
Return a copy of the string S with leading and trailing\n\
Return a copy of the string S with leading and trailing\n\
whitespace removed.\n\
whitespace removed.\n\
...
@@ -7229,7 +7229,7 @@ unicode_strip(PyUnicodeObject *self, PyObject *args)
...
@@ -7229,7 +7229,7 @@ unicode_strip(PyUnicodeObject *self, PyObject *args)
PyDoc_STRVAR(lstrip__doc__,
PyDoc_STRVAR(lstrip__doc__,
"S.lstrip([chars]) -> unicode\n\
"S.lstrip([chars]) -> unicode\n\
\n\
\n\
Return a copy of the string S with leading whitespace removed.\n\
Return a copy of the string S with leading whitespace removed.\n\
If chars is given and not None, remove characters in chars instead.\n\
If chars is given and not None, remove characters in chars instead.\n\
...
@@ -7246,7 +7246,7 @@ unicode_lstrip(PyUnicodeObject *self, PyObject *args)
...
@@ -7246,7 +7246,7 @@ unicode_lstrip(PyUnicodeObject *self, PyObject *args)
PyDoc_STRVAR(rstrip__doc__,
PyDoc_STRVAR(rstrip__doc__,
"S.rstrip([chars]) -> unicode\n\
"S.rstrip([chars]) -> unicode\n\
\n\
\n\
Return a copy of the string S with trailing whitespace removed.\n\
Return a copy of the string S with trailing whitespace removed.\n\
If chars is given and not None, remove characters in chars instead.\n\
If chars is given and not None, remove characters in chars instead.\n\
...
@@ -7353,7 +7353,7 @@ PyObject *PyUnicode_Replace(PyObject *obj,
...
@@ -7353,7 +7353,7 @@ PyObject *PyUnicode_Replace(PyObject *obj,
}
}
PyDoc_STRVAR(replace__doc__,
PyDoc_STRVAR(replace__doc__,
"S.replace (old, new[, count]) -> unicode\n\
"S.replace (old, new[, count]) -> unicode\n\
\n\
\n\
Return a copy of S with all occurrences of substring\n\
Return a copy of S with all occurrences of substring\n\
old replaced by new. If the optional argument count is\n\
old replaced by new. If the optional argument count is\n\
...
@@ -7394,7 +7394,7 @@ PyObject *unicode_repr(PyObject *unicode)
...
@@ -7394,7 +7394,7 @@ PyObject *unicode_repr(PyObject *unicode)
}
}
PyDoc_STRVAR(rfind__doc__,
PyDoc_STRVAR(rfind__doc__,
"S.rfind(sub [,start [,end]]) -> int\n\
"S.rfind(sub [,start [,end]]) -> int\n\
\n\
\n\
Return the highest index in S where substring sub is found,\n\
Return the highest index in S where substring sub is found,\n\
such that sub is contained within s[start:end]. Optional\n\
such that sub is contained within s[start:end]. Optional\n\
...
@@ -7425,7 +7425,7 @@ unicode_rfind(PyUnicodeObject *self, PyObject *args)
...
@@ -7425,7 +7425,7 @@ unicode_rfind(PyUnicodeObject *self, PyObject *args)
}
}
PyDoc_STRVAR(rindex__doc__,
PyDoc_STRVAR(rindex__doc__,
"S.rindex(sub [,start [,end]]) -> int\n\
"S.rindex(sub [,start [,end]]) -> int\n\
\n\
\n\
Like S.rfind() but raise ValueError when the substring is not found.");
Like S.rfind() but raise ValueError when the substring is not found.");
...
@@ -7456,7 +7456,7 @@ unicode_rindex(PyUnicodeObject *self, PyObject *args)
...
@@ -7456,7 +7456,7 @@ unicode_rindex(PyUnicodeObject *self, PyObject *args)
}
}
PyDoc_STRVAR(rjust__doc__,
PyDoc_STRVAR(rjust__doc__,
"S.rjust(width[, fillchar]) -> unicode\n\
"S.rjust(width[, fillchar]) -> unicode\n\
\n\
\n\
Return S right-justified in a Unicode string of length width. Padding is\n\
Return S right-justified in a Unicode string of length width. Padding is\n\
done using the specified fill character (default is a space).");
done using the specified fill character (default is a space).");
...
@@ -7525,7 +7525,7 @@ PyObject *PyUnicode_Split(PyObject *s,
...
@@ -7525,7 +7525,7 @@ PyObject *PyUnicode_Split(PyObject *s,
}
}
PyDoc_STRVAR(split__doc__,
PyDoc_STRVAR(split__doc__,
"S.split([sep [,maxsplit]]) -> list of strings\n\
"S.split([sep [,maxsplit]]) -> list of strings\n\
\n\
\n\
Return a list of the words in S, using sep as the\n\
Return a list of the words in S, using sep as the\n\
delimiter string. If maxsplit is given, at most maxsplit\n\
delimiter string. If maxsplit is given, at most maxsplit\n\
...
@@ -7606,7 +7606,7 @@ PyUnicode_RPartition(PyObject *str_in, PyObject *sep_in)
...
@@ -7606,7 +7606,7 @@ PyUnicode_RPartition(PyObject *str_in, PyObject *sep_in)
}
}
PyDoc_STRVAR(partition__doc__,
PyDoc_STRVAR(partition__doc__,
"S.partition(sep) -> (head, sep, tail)\n\
"S.partition(sep) -> (head, sep, tail)\n\
\n\
\n\
Search for the separator sep in S, and return the part before it,\n\
Search for the separator sep in S, and return the part before it,\n\
the separator itself, and the part after it. If the separator is not\n\
the separator itself, and the part after it. If the separator is not\n\
...
@@ -7619,7 +7619,7 @@ unicode_partition(PyUnicodeObject *self, PyObject *separator)
...
@@ -7619,7 +7619,7 @@ unicode_partition(PyUnicodeObject *self, PyObject *separator)
}
}
PyDoc_STRVAR(rpartition__doc__,
PyDoc_STRVAR(rpartition__doc__,
"S.rpartition(sep) -> (tail, sep, head)\n\
"S.rpartition(sep) -> (tail, sep, head)\n\
\n\
\n\
Search for the separator sep in S, starting at the end of S, and return\n\
Search for the separator sep in S, starting at the end of S, and return\n\
the part before it, the separator itself, and the part after it. If the\n\
the part before it, the separator itself, and the part after it. If the\n\
...
@@ -7656,7 +7656,7 @@ PyObject *PyUnicode_RSplit(PyObject *s,
...
@@ -7656,7 +7656,7 @@ PyObject *PyUnicode_RSplit(PyObject *s,
}
}
PyDoc_STRVAR(rsplit__doc__,
PyDoc_STRVAR(rsplit__doc__,
"S.rsplit([sep [,maxsplit]]) -> list of strings\n\
"S.rsplit([sep [,maxsplit]]) -> list of strings\n\
\n\
\n\
Return a list of the words in S, using sep as the\n\
Return a list of the words in S, using sep as the\n\
delimiter string, starting at the end of the string and\n\
delimiter string, starting at the end of the string and\n\
...
@@ -7682,7 +7682,7 @@ unicode_rsplit(PyUnicodeObject *self, PyObject *args)
...
@@ -7682,7 +7682,7 @@ unicode_rsplit(PyUnicodeObject *self, PyObject *args)
}
}
PyDoc_STRVAR(splitlines__doc__,
PyDoc_STRVAR(splitlines__doc__,
"S.splitlines([keepends]) -> list of strings\n\
"S.splitlines([keepends]) -> list of strings\n\
\n\
\n\
Return a list of the lines in S, breaking at line boundaries.\n\
Return a list of the lines in S, breaking at line boundaries.\n\
Line breaks are not included in the resulting list unless keepends\n\
Line breaks are not included in the resulting list unless keepends\n\
...
@@ -7706,7 +7706,7 @@ PyObject *unicode_str(PyUnicodeObject *self)
...
@@ -7706,7 +7706,7 @@ PyObject *unicode_str(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(swapcase__doc__,
PyDoc_STRVAR(swapcase__doc__,
"S.swapcase() -> unicode\n\
"S.swapcase() -> unicode\n\
\n\
\n\
Return a copy of S with uppercase characters converted to lowercase\n\
Return a copy of S with uppercase characters converted to lowercase\n\
and vice versa.");
and vice versa.");
...
@@ -7718,7 +7718,7 @@ unicode_swapcase(PyUnicodeObject *self)
...
@@ -7718,7 +7718,7 @@ unicode_swapcase(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(translate__doc__,
PyDoc_STRVAR(translate__doc__,
"S.translate(table) -> unicode\n\
"S.translate(table) -> unicode\n\
\n\
\n\
Return a copy of the string S, where all characters have been mapped\n\
Return a copy of the string S, where all characters have been mapped\n\
through the given translation table, which must be a mapping of\n\
through the given translation table, which must be a mapping of\n\
...
@@ -7736,7 +7736,7 @@ unicode_translate(PyUnicodeObject *self, PyObject *table)
...
@@ -7736,7 +7736,7 @@ unicode_translate(PyUnicodeObject *self, PyObject *table)
}
}
PyDoc_STRVAR(upper__doc__,
PyDoc_STRVAR(upper__doc__,
"S.upper() -> unicode\n\
"S.upper() -> unicode\n\
\n\
\n\
Return a copy of S converted to uppercase.");
Return a copy of S converted to uppercase.");
...
@@ -7747,7 +7747,7 @@ unicode_upper(PyUnicodeObject *self)
...
@@ -7747,7 +7747,7 @@ unicode_upper(PyUnicodeObject *self)
}
}
PyDoc_STRVAR(zfill__doc__,
PyDoc_STRVAR(zfill__doc__,
"S.zfill(width) -> unicode\n\
"S.zfill(width) -> unicode\n\
\n\
\n\
Pad a numeric string S with zeros on the left, to fill a field\n\
Pad a numeric string S with zeros on the left, to fill a field\n\
of the specified width. The string S is never truncated.");
of the specified width. The string S is never truncated.");
...
@@ -7799,7 +7799,7 @@ free_listsize(PyUnicodeObject *self)
...
@@ -7799,7 +7799,7 @@ free_listsize(PyUnicodeObject *self)
#endif
#endif
PyDoc_STRVAR(startswith__doc__,
PyDoc_STRVAR(startswith__doc__,
"S.startswith(prefix[, start[, end]]) -> bool\n\
"S.startswith(prefix[, start[, end]]) -> bool\n\
\n\
\n\
Return True if S starts with the specified prefix, False otherwise.\n\
Return True if S starts with the specified prefix, False otherwise.\n\
With optional start, test S beginning at that position.\n\
With optional start, test S beginning at that position.\n\
...
@@ -7845,7 +7845,7 @@ unicode_startswith(PyUnicodeObject *self,
...
@@ -7845,7 +7845,7 @@ unicode_startswith(PyUnicodeObject *self,
PyDoc_STRVAR(endswith__doc__,
PyDoc_STRVAR(endswith__doc__,
"S.endswith(suffix[, start[, end]]) -> bool\n\
"S.endswith(suffix[, start[, end]]) -> bool\n\
\n\
\n\
Return True if S ends with the specified suffix, False otherwise.\n\
Return True if S ends with the specified suffix, False otherwise.\n\
With optional start, test S beginning at that position.\n\
With optional start, test S beginning at that position.\n\
...
@@ -7894,7 +7894,7 @@ unicode_endswith(PyUnicodeObject *self,
...
@@ -7894,7 +7894,7 @@ unicode_endswith(PyUnicodeObject *self,
#include "stringlib/string_format.h"
#include "stringlib/string_format.h"
PyDoc_STRVAR(format__doc__,
PyDoc_STRVAR(format__doc__,
"S.format(*args, **kwargs) -> unicode\n\
"S.format(*args, **kwargs) -> unicode\n\
\n\
\n\
");
");
...
@@ -7922,13 +7922,13 @@ unicode__format__(PyObject *self, PyObject *args)
...
@@ -7922,13 +7922,13 @@ unicode__format__(PyObject *self, PyObject *args)
result = _PyUnicode_FormatAdvanced(self,
result = _PyUnicode_FormatAdvanced(self,
PyUnicode_AS_UNICODE(format_spec),
PyUnicode_AS_UNICODE(format_spec),
PyUnicode_GET_SIZE(format_spec));
PyUnicode_GET_SIZE(format_spec));
done:
done:
Py_XDECREF(tmp);
Py_XDECREF(tmp);
return result;
return result;
}
}
PyDoc_STRVAR(p_format__doc__,
PyDoc_STRVAR(p_format__doc__,
"S.__format__(format_spec) -> unicode\n\
"S.__format__(format_spec) -> unicode\n\
\n\
\n\
");
");
...
@@ -7940,7 +7940,7 @@ unicode__sizeof__(PyUnicodeObject *v)
...
@@ -7940,7 +7940,7 @@ unicode__sizeof__(PyUnicodeObject *v)
}
}
PyDoc_STRVAR(sizeof__doc__,
PyDoc_STRVAR(sizeof__doc__,
"S.__sizeof__() -> size of S in memory, in bytes\n\
"S.__sizeof__() -> size of S in memory, in bytes\n\
\n\
\n\
");
");
...
@@ -8937,7 +8937,7 @@ unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -8937,7 +8937,7 @@ unicode_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
}
PyDoc_STRVAR(unicode_doc,
PyDoc_STRVAR(unicode_doc,
"unicode(string [, encoding[, errors]]) -> object\n\
"unicode(string [, encoding[, errors]]) -> object\n\
\n\
\n\
Create a new Unicode object from the given encoded string.\n\
Create a new Unicode object from the given encoded string.\n\
encoding defaults to the current default string encoding.\n\
encoding defaults to the current default string encoding.\n\
...
@@ -9071,8 +9071,8 @@ _PyUnicode_Fini(void)
...
@@ -9071,8 +9071,8 @@ _PyUnicode_Fini(void)
/*
/*
Local variables:
Local variables:
c-basic-offset: 4
c-basic-offset: 4
indent-tabs-mode: nil
indent-tabs-mode: nil
End:
End:
*/
*/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment