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
3567a876
Kaydet (Commit)
3567a876
authored
Haz 28, 2003
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add take() to examples. Tighten the islice() example
üst
5d2f515d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
libitertools.tex
Doc/lib/libitertools.tex
+4
-1
test_itertools.py
Lib/test/test_itertools.py
+7
-1
No files found.
Doc/lib/libitertools.tex
Dosyayı görüntüle @
3567a876
...
...
@@ -314,7 +314,7 @@ Check 1202 is for $823.14
>>> reportlines
=
[
'EuroPython', 'Roster', '', 'alex', '', 'laura',
'', 'martin', '', 'walter', '', 'samuele'
]
>>> for name in islice
(
reportlines,
3
,
len
(
reportlines
)
,
2
)
:
>>> for name in islice
(
reportlines,
3
,
None
,
2
)
:
... print name.title
()
...
Alex
...
...
@@ -380,4 +380,7 @@ from building blocks.
... result
=
result
[
1
:
]
+
(
elem,
)
... yield result
>>> def take
(
n, seq
)
:
... return list
(
islice
(
seq, n
))
\end
{
verbatim
}
Lib/test/test_itertools.py
Dosyayı görüntüle @
3567a876
...
...
@@ -392,7 +392,7 @@ Check 1202 is for $823.14
27
>>> reportlines = ['EuroPython', 'Roster', '', 'alex', '', 'laura', '', 'martin', '', 'walter', '', 'samuele']
>>> for name in islice(reportlines, 3,
len(reportlines)
, 2):
>>> for name in islice(reportlines, 3,
None
, 2):
... print name.title()
...
Alex
...
...
@@ -449,6 +449,9 @@ Samuele
... result = result[1:] + (elem,)
... yield result
>>> def take(n, seq):
... return list(islice(seq, n))
This is not part of the examples but it tests to make sure the definitions
perform as purported.
...
...
@@ -494,6 +497,9 @@ False
>>> dotproduct([1,2,3], [4,5,6])
32
>>> take(10, count())
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
"""
__test__
=
{
'libreftest'
:
libreftest
}
...
...
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