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
66517483
Kaydet (Commit)
66517483
authored
Ara 03, 2004
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove PyRange_New().
üst
f9245578
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
47 deletions
+2
-47
rangeobject.h
Include/rangeobject.h
+0
-2
NEWS
Misc/NEWS
+2
-0
rangeobject.c
Objects/rangeobject.c
+0
-45
No files found.
Include/rangeobject.h
Dosyayı görüntüle @
66517483
...
...
@@ -22,8 +22,6 @@ PyAPI_DATA(PyTypeObject) PyRange_Type;
#define PyRange_Check(op) ((op)->ob_type == &PyRange_Type)
PyAPI_FUNC
(
PyObject
*
)
PyRange_New
(
long
,
long
,
long
,
int
);
#ifdef __cplusplus
}
#endif
...
...
Misc/NEWS
Dosyayı görüntüle @
66517483
...
...
@@ -32,6 +32,8 @@ Build
C API
-----
- Removed PyRange_New().
Tests
-----
...
...
Objects/rangeobject.c
Dosyayı görüntüle @
66517483
...
...
@@ -9,51 +9,6 @@ typedef struct {
long
len
;
}
rangeobject
;
/* XXX PyRange_New should be deprecated. It's not documented. It's not
* used in the core. Its error-checking is akin to Swiss cheese: accepts
* step == 0; accepts len < 0; ignores that (len - 1) * step may overflow;
* raises a baffling "integer addition" exception if it thinks the last
* item is "too big"; and doesn't compute whether "last item is too big"
* correctly even if the multiplication doesn't overflow.
*/
PyObject
*
PyRange_New
(
long
start
,
long
len
,
long
step
,
int
reps
)
{
rangeobject
*
obj
;
if
(
reps
!=
1
)
{
PyErr_SetString
(
PyExc_ValueError
,
"PyRange_New's 'repetitions' argument must be 1"
);
return
NULL
;
}
obj
=
PyObject_New
(
rangeobject
,
&
PyRange_Type
);
if
(
obj
==
NULL
)
return
NULL
;
if
(
len
==
0
)
{
start
=
0
;
len
=
0
;
step
=
1
;
}
else
{
long
last
=
start
+
(
len
-
1
)
*
step
;
if
((
step
>
0
)
?
(
last
>
(
PyInt_GetMax
()
-
step
))
:
(
last
<
(
-
1
-
PyInt_GetMax
()
-
step
)))
{
PyErr_SetString
(
PyExc_OverflowError
,
"integer addition"
);
Py_DECREF
(
obj
);
return
NULL
;
}
}
obj
->
start
=
start
;
obj
->
len
=
len
;
obj
->
step
=
step
;
return
(
PyObject
*
)
obj
;
}
/* Return number of items in range/xrange (lo, hi, step). step > 0
* required. Return a value < 0 if & only if the true value is too
* large to fit in a signed long.
...
...
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