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
b7f1da5a
Kaydet (Commit)
b7f1da5a
authored
Mar 21, 2012
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
make _PyNumber_ConvertIntegralToInt static, since it's only used in abstract.c
üst
d614e707
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
19 deletions
+10
-19
abstract.h
Include/abstract.h
+0
-15
abstract.c
Objects/abstract.c
+10
-4
No files found.
Include/abstract.h
Dosyayı görüntüle @
b7f1da5a
...
...
@@ -772,21 +772,6 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
PyAPI_FUNC
(
Py_ssize_t
)
PyNumber_AsSsize_t
(
PyObject
*
o
,
PyObject
*
exc
);
/*
Returns the Integral instance converted to an int. The
instance is expected to be int or long or have an __int__
method. Steals integral's reference. error_format will be
used to create the TypeError if integral isn't actually an
Integral instance. error_format should be a format string
that can accept a char* naming integral's type.
*/
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
PyObject
*
)
_PyNumber_ConvertIntegralToInt
(
PyObject
*
integral
,
const
char
*
error_format
);
#endif
/*
Returns the object converted to Py_ssize_t by going through
PyNumber_Index first. If an overflow error occurs while
...
...
Objects/abstract.c
Dosyayı görüntüle @
b7f1da5a
...
...
@@ -1268,8 +1268,15 @@ PyNumber_AsSsize_t(PyObject *item, PyObject *err)
}
PyObject
*
_PyNumber_ConvertIntegralToInt
(
PyObject
*
integral
,
const
char
*
error_format
)
/*
Returns the Integral instance converted to an int. The instance is expected
to be an int or have an __int__ method. Steals integral's
reference. error_format will be used to create the TypeError if integral
isn't actually an Integral instance. error_format should be a format string
that can accept a char* naming integral's type.
*/
static
PyObject
*
convert_integral_to_int
(
PyObject
*
integral
,
const
char
*
error_format
)
{
PyNumberMethods
*
nb
;
if
(
PyLong_Check
(
integral
))
...
...
@@ -1345,8 +1352,7 @@ PyNumber_Long(PyObject *o)
Py_DECREF
(
trunc_func
);
/* __trunc__ is specified to return an Integral type,
but long() needs to return a long. */
int_instance
=
_PyNumber_ConvertIntegralToInt
(
truncated
,
int_instance
=
convert_integral_to_int
(
truncated
,
"__trunc__ returned non-Integral (type %.200s)"
);
return
int_instance
;
}
...
...
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