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
4ad94210
Kaydet (Commit)
4ad94210
authored
May 21, 2007
tarafından
Walter Dörwald
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rename test_xrange.py to test_range.py and fix the
type name in various spots.
üst
03b43d8a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
7 deletions
+4
-7
rangeobject.h
Include/rangeobject.h
+0
-3
test_range.py
Lib/test/test_range.py
+2
-2
rangeobject.c
Objects/rangeobject.c
+2
-2
No files found.
Include/rangeobject.h
Dosyayı görüntüle @
4ad94210
...
@@ -7,9 +7,6 @@
...
@@ -7,9 +7,6 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
/* This is about the type 'xrange', not the built-in function range(), which
returns regular lists. */
/*
/*
A range object represents an integer range. This is an immutable object;
A range object represents an integer range. This is an immutable object;
a range cannot change its value after creation.
a range cannot change its value after creation.
...
...
Lib/test/test_
x
range.py
→
Lib/test/test_range.py
Dosyayı görüntüle @
4ad94210
...
@@ -7,8 +7,8 @@ import warnings
...
@@ -7,8 +7,8 @@ import warnings
warnings
.
filterwarnings
(
"ignore"
,
"integer argument expected"
,
warnings
.
filterwarnings
(
"ignore"
,
"integer argument expected"
,
DeprecationWarning
,
"unittest"
)
DeprecationWarning
,
"unittest"
)
class
Xr
angeTest
(
unittest
.
TestCase
):
class
R
angeTest
(
unittest
.
TestCase
):
def
test_
x
range
(
self
):
def
test_range
(
self
):
self
.
assertEqual
(
list
(
range
(
3
)),
[
0
,
1
,
2
])
self
.
assertEqual
(
list
(
range
(
3
)),
[
0
,
1
,
2
])
self
.
assertEqual
(
list
(
range
(
1
,
5
)),
[
1
,
2
,
3
,
4
])
self
.
assertEqual
(
list
(
range
(
1
,
5
)),
[
1
,
2
,
3
,
4
])
self
.
assertEqual
(
list
(
range
(
0
)),
[])
self
.
assertEqual
(
list
(
range
(
0
)),
[])
...
...
Objects/rangeobject.c
Dosyayı görüntüle @
4ad94210
...
@@ -214,7 +214,7 @@ range_item(rangeobject *r, Py_ssize_t i)
...
@@ -214,7 +214,7 @@ range_item(rangeobject *r, Py_ssize_t i)
if
(
i
<
0
||
i
>=
len
)
{
if
(
i
<
0
||
i
>=
len
)
{
if
(
!
PyErr_Occurred
())
if
(
!
PyErr_Occurred
())
PyErr_SetString
(
PyExc_IndexError
,
PyErr_SetString
(
PyExc_IndexError
,
"
x
range object index out of range"
);
"range object index out of range"
);
return
NULL
;
return
NULL
;
}
}
...
@@ -313,7 +313,7 @@ PyTypeObject PyRange_Type = {
...
@@ -313,7 +313,7 @@ PyTypeObject PyRange_Type = {
range_new
,
/* tp_new */
range_new
,
/* tp_new */
};
};
/***********************
X
range Iterator **************************/
/*********************** range Iterator **************************/
/* There are 2 types of iterators, one for C longs, the other for
/* There are 2 types of iterators, one for C longs, the other for
Python longs (ie, PyObjects). This should make iteration fast
Python longs (ie, PyObjects). This should make iteration fast
...
...
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