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
1fe5f388
Kaydet (Commit)
1fe5f388
authored
Agu 31, 2007
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove checking redundantly for checks of PyInt and PyLong.
üst
538d17aa
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
15 deletions
+14
-15
_randommodule.c
Modules/_randommodule.c
+2
-2
_sre.c
Modules/_sre.c
+1
-1
datetimemodule.c
Modules/datetimemodule.c
+5
-5
abstract.c
Objects/abstract.c
+3
-4
floatobject.c
Objects/floatobject.c
+1
-1
sliceobject.c
Objects/sliceobject.c
+1
-1
_winreg.c
PC/_winreg.c
+1
-1
No files found.
Modules/_randommodule.c
Dosyayı görüntüle @
1fe5f388
...
...
@@ -231,7 +231,7 @@ random_seed(RandomObject *self, PyObject *args)
/* If the arg is an int or long, use its absolute value; else use
* the absolute value of its hash code.
*/
if
(
Py
Int_Check
(
arg
)
||
Py
Long_Check
(
arg
))
if
(
PyLong_Check
(
arg
))
n
=
PyNumber_Absolute
(
arg
);
else
{
long
hash
=
PyObject_Hash
(
arg
);
...
...
@@ -401,7 +401,7 @@ random_jumpahead(RandomObject *self, PyObject *n)
PyObject
*
remobj
;
unsigned
long
*
mt
,
tmp
;
if
(
!
Py
Int_Check
(
n
)
&&
!
Py
Long_Check
(
n
))
{
if
(
!
PyLong_Check
(
n
))
{
PyErr_Format
(
PyExc_TypeError
,
"jumpahead requires an "
"integer, not '%s'"
,
Py_Type
(
n
)
->
tp_name
);
...
...
Modules/_sre.c
Dosyayı görüntüle @
1fe5f388
...
...
@@ -2764,7 +2764,7 @@ match_getindex(MatchObject* self, PyObject* index)
if
(
self
->
pattern
->
groupindex
)
{
index
=
PyObject_GetItem
(
self
->
pattern
->
groupindex
,
index
);
if
(
index
)
{
if
(
Py
Int_Check
(
index
)
||
Py
Long_Check
(
index
))
if
(
PyLong_Check
(
index
))
i
=
PyInt_AsSsize_t
(
index
);
Py_DECREF
(
index
);
}
else
...
...
Modules/datetimemodule.c
Dosyayı görüntüle @
1fe5f388
...
...
@@ -1758,11 +1758,11 @@ delta_multiply(PyObject *left, PyObject *right)
if
(
PyDelta_Check
(
left
))
{
/* delta * ??? */
if
(
Py
Int_Check
(
right
)
||
Py
Long_Check
(
right
))
if
(
PyLong_Check
(
right
))
result
=
multiply_int_timedelta
(
right
,
(
PyDateTime_Delta
*
)
left
);
}
else
if
(
Py
Int_Check
(
left
)
||
Py
Long_Check
(
left
))
else
if
(
PyLong_Check
(
left
))
result
=
multiply_int_timedelta
(
left
,
(
PyDateTime_Delta
*
)
right
);
...
...
@@ -1778,7 +1778,7 @@ delta_divide(PyObject *left, PyObject *right)
if
(
PyDelta_Check
(
left
))
{
/* delta * ??? */
if
(
Py
Int_Check
(
right
)
||
Py
Long_Check
(
right
))
if
(
PyLong_Check
(
right
))
result
=
divide_timedelta_int
(
(
PyDateTime_Delta
*
)
left
,
right
);
...
...
@@ -1807,7 +1807,7 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor,
assert
(
num
!=
NULL
);
if
(
Py
Int_Check
(
num
)
||
Py
Long_Check
(
num
))
{
if
(
PyLong_Check
(
num
))
{
prod
=
PyNumber_Multiply
(
num
,
factor
);
if
(
prod
==
NULL
)
return
NULL
;
...
...
@@ -1855,7 +1855,7 @@ accum(const char* tag, PyObject *sofar, PyObject *num, PyObject *factor,
* fractional part requires float arithmetic, and may
* lose a little info.
*/
assert
(
Py
Int_Check
(
factor
)
||
Py
Long_Check
(
factor
));
assert
(
PyLong_Check
(
factor
));
dnum
=
PyLong_AsDouble
(
factor
);
dnum
*=
fracpart
;
...
...
Objects/abstract.c
Dosyayı görüntüle @
1fe5f388
...
...
@@ -1153,14 +1153,13 @@ PyNumber_Index(PyObject *item)
PyObject
*
result
=
NULL
;
if
(
item
==
NULL
)
return
null_error
();
if
(
Py
Int_Check
(
item
)
||
Py
Long_Check
(
item
))
{
if
(
PyLong_Check
(
item
))
{
Py_INCREF
(
item
);
return
item
;
}
if
(
PyIndex_Check
(
item
))
{
result
=
item
->
ob_type
->
tp_as_number
->
nb_index
(
item
);
if
(
result
&&
!
PyInt_Check
(
result
)
&&
!
PyLong_Check
(
result
))
{
if
(
result
&&
!
PyLong_Check
(
result
))
{
PyErr_Format
(
PyExc_TypeError
,
"__index__ returned non-int "
"(type %.200s)"
,
...
...
@@ -1270,7 +1269,7 @@ PyNumber_Long(PyObject *o)
}
if
(
m
&&
m
->
nb_long
)
{
/* This should include subclasses of long */
PyObject
*
res
=
m
->
nb_long
(
o
);
if
(
res
&&
(
!
PyInt_Check
(
res
)
&&
!
PyLong_Check
(
res
)
))
{
if
(
res
&&
!
PyLong_Check
(
res
))
{
PyErr_Format
(
PyExc_TypeError
,
"__long__ returned non-long (type %.200s)"
,
res
->
ob_type
->
tp_name
);
...
...
Objects/floatobject.c
Dosyayı görüntüle @
1fe5f388
...
...
@@ -331,7 +331,7 @@ float_richcompare(PyObject *v, PyObject *w, int op)
j
=
PyFloat_AS_DOUBLE
(
w
);
else
if
(
!
Py_IS_FINITE
(
i
))
{
if
(
Py
Int_Check
(
w
)
||
Py
Long_Check
(
w
))
if
(
PyLong_Check
(
w
))
/* If i is an infinity, its magnitude exceeds any
* finite integer, so it doesn't matter which int we
* compare i with. If i is a NaN, similarly.
...
...
Objects/sliceobject.c
Dosyayı görüntüle @
1fe5f388
...
...
@@ -106,7 +106,7 @@ PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
if
(
r
->
step
==
Py_None
)
{
*
step
=
1
;
}
else
{
if
(
!
Py
Int_Check
(
r
->
step
)
&&
!
Py
Long_Check
(
r
->
step
))
return
-
1
;
if
(
!
PyLong_Check
(
r
->
step
))
return
-
1
;
*
step
=
PyInt_AsSsize_t
(
r
->
step
);
}
if
(
r
->
start
==
Py_None
)
{
...
...
PC/_winreg.c
Dosyayı görüntüle @
1fe5f388
...
...
@@ -575,7 +575,7 @@ PyHKEY_AsHKEY(PyObject *ob, HKEY *pHANDLE, BOOL bNoneOK)
PyHKEYObject
*
pH
=
(
PyHKEYObject
*
)
ob
;
*
pHANDLE
=
pH
->
hkey
;
}
else
if
(
Py
Int_Check
(
ob
)
||
Py
Long_Check
(
ob
))
{
else
if
(
PyLong_Check
(
ob
))
{
/* We also support integers */
PyErr_Clear
();
*
pHANDLE
=
(
HKEY
)
PyLong_AsVoidPtr
(
ob
);
...
...
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