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
60bc809d
Kaydet (Commit)
60bc809d
authored
Haz 14, 2000
tarafından
Marc-André Lemburg
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Marc-Andre Lemburg <mal@lemburg.com>:
Added code so that .isXXX() testing returns 0 for emtpy strings.
üst
bddf502a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
stringobject.c
Objects/stringobject.c
+20
-0
unicodeobject.c
Objects/unicodeobject.c
+28
-0
No files found.
Objects/stringobject.c
Dosyayı görüntüle @
60bc809d
...
...
@@ -1927,6 +1927,10 @@ string_isspace(PyStringObject *self, PyObject *args)
isspace
(
*
p
))
return
PyInt_FromLong
(
1
);
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyString_GET_SIZE
(
self
);
for
(;
p
<
e
;
p
++
)
{
if
(
!
isspace
(
*
p
))
...
...
@@ -1956,6 +1960,10 @@ string_isdigit(PyStringObject *self, PyObject *args)
isdigit
(
*
p
))
return
PyInt_FromLong
(
1
);
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyString_GET_SIZE
(
self
);
for
(;
p
<
e
;
p
++
)
{
if
(
!
isdigit
(
*
p
))
...
...
@@ -1985,6 +1993,10 @@ string_islower(PyStringObject *self, PyObject *args)
if
(
PyString_GET_SIZE
(
self
)
==
1
)
return
PyInt_FromLong
(
islower
(
*
p
)
!=
0
);
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyString_GET_SIZE
(
self
);
cased
=
0
;
for
(;
p
<
e
;
p
++
)
{
...
...
@@ -2017,6 +2029,10 @@ string_isupper(PyStringObject *self, PyObject *args)
if
(
PyString_GET_SIZE
(
self
)
==
1
)
return
PyInt_FromLong
(
isupper
(
*
p
)
!=
0
);
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyString_GET_SIZE
(
self
);
cased
=
0
;
for
(;
p
<
e
;
p
++
)
{
...
...
@@ -2050,6 +2066,10 @@ string_istitle(PyStringObject *self, PyObject *args)
if
(
PyString_GET_SIZE
(
self
)
==
1
)
return
PyInt_FromLong
(
isupper
(
*
p
)
!=
0
);
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyString_GET_SIZE
(
self
);
cased
=
0
;
previous_is_cased
=
0
;
...
...
Objects/unicodeobject.c
Dosyayı görüntüle @
60bc809d
...
...
@@ -3306,6 +3306,10 @@ unicode_islower(PyUnicodeObject *self, PyObject *args)
if
(
PyUnicode_GET_SIZE
(
self
)
==
1
)
return
PyInt_FromLong
(
Py_UNICODE_ISLOWER
(
*
p
)
!=
0
);
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyUnicode_GET_SIZE
(
self
);
cased
=
0
;
for
(;
p
<
e
;
p
++
)
{
...
...
@@ -3339,6 +3343,10 @@ unicode_isupper(PyUnicodeObject *self, PyObject *args)
if
(
PyUnicode_GET_SIZE
(
self
)
==
1
)
return
PyInt_FromLong
(
Py_UNICODE_ISUPPER
(
*
p
)
!=
0
);
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyUnicode_GET_SIZE
(
self
);
cased
=
0
;
for
(;
p
<
e
;
p
++
)
{
...
...
@@ -3374,6 +3382,10 @@ unicode_istitle(PyUnicodeObject *self, PyObject *args)
return
PyInt_FromLong
((
Py_UNICODE_ISTITLE
(
*
p
)
!=
0
)
||
(
Py_UNICODE_ISUPPER
(
*
p
)
!=
0
));
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyUnicode_GET_SIZE
(
self
);
cased
=
0
;
previous_is_cased
=
0
;
...
...
@@ -3418,6 +3430,10 @@ unicode_isspace(PyUnicodeObject *self, PyObject *args)
Py_UNICODE_ISSPACE
(
*
p
))
return
PyInt_FromLong
(
1
);
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyUnicode_GET_SIZE
(
self
);
for
(;
p
<
e
;
p
++
)
{
if
(
!
Py_UNICODE_ISSPACE
(
*
p
))
...
...
@@ -3446,6 +3462,10 @@ unicode_isdecimal(PyUnicodeObject *self, PyObject *args)
Py_UNICODE_ISDECIMAL
(
*
p
))
return
PyInt_FromLong
(
1
);
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyUnicode_GET_SIZE
(
self
);
for
(;
p
<
e
;
p
++
)
{
if
(
!
Py_UNICODE_ISDECIMAL
(
*
p
))
...
...
@@ -3474,6 +3494,10 @@ unicode_isdigit(PyUnicodeObject *self, PyObject *args)
Py_UNICODE_ISDIGIT
(
*
p
))
return
PyInt_FromLong
(
1
);
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyUnicode_GET_SIZE
(
self
);
for
(;
p
<
e
;
p
++
)
{
if
(
!
Py_UNICODE_ISDIGIT
(
*
p
))
...
...
@@ -3502,6 +3526,10 @@ unicode_isnumeric(PyUnicodeObject *self, PyObject *args)
Py_UNICODE_ISNUMERIC
(
*
p
))
return
PyInt_FromLong
(
1
);
/* Special case for empty strings */
if
(
PyString_GET_SIZE
(
self
)
==
0
)
return
PyInt_FromLong
(
0
);
e
=
p
+
PyUnicode_GET_SIZE
(
self
);
for
(;
p
<
e
;
p
++
)
{
if
(
!
Py_UNICODE_ISNUMERIC
(
*
p
))
...
...
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