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
2e669408
Kaydet (Commit)
2e669408
authored
Haz 12, 2004
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Minor wording and spacing nits.
üst
34809170
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
libcollections.tex
Doc/lib/libcollections.tex
+7
-9
libitertools.tex
Doc/lib/libitertools.tex
+0
-2
No files found.
Doc/lib/libcollections.tex
Dosyayı görüntüle @
2e669408
...
@@ -135,12 +135,10 @@ deque(['c', 'b', 'a'])
...
@@ -135,12 +135,10 @@ deque(['c', 'b', 'a'])
This section shows various approaches to working with deques.
This section shows various approaches to working with deques.
The
\method
{
rotate()
}
method provides a way to implement
\class
{
deque
}
The
\method
{
rotate()
}
method provides a way to implement
\class
{
deque
}
slicing and deletion:
slicing and deletion. For example, a pure python implementation of
\code
{
del d[n]
}
relies on the
\method
{
rotate()
}
method to position
This pure python implementation of
\code
{
del d[n]
}
shows how to use the
elements to be popped:
\method
{
rotate()
}
method as a building block for implementing a variety
of class
{
deque
}
operations:
\begin{verbatim}
\begin{verbatim}
def delete
_
nth(d, n):
def delete
_
nth(d, n):
d.rotate(-n)
d.rotate(-n)
...
@@ -188,9 +186,9 @@ h
...
@@ -188,9 +186,9 @@ h
Multi-pass data reduction algorithms can be succinctly expressed and
Multi-pass data reduction algorithms can be succinctly expressed and
efficiently coded by extracting elements
using
multiple calls to
efficiently coded by extracting elements
with
multiple calls to
\method
{
popleft()
}
, applying the reduction function, and
us
ing
\method
{
popleft()
}
, applying the reduction function, and
call
ing
\method
{
append()
}
for adding
the result back to the queue.
\method
{
append()
}
to add
the result back to the queue.
For example, building a balanced binary tree of nested lists entails
For example, building a balanced binary tree of nested lists entails
reducing two adjacent nodes into one by grouping them in a list:
reducing two adjacent nodes into one by grouping them in a list:
...
...
Doc/lib/libitertools.tex
Dosyayı görüntüle @
2e669408
...
@@ -476,7 +476,6 @@ def padnone(seq):
...
@@ -476,7 +476,6 @@ def padnone(seq):
"""Returns the sequence elements and then returns None indefinitely.
"""Returns the sequence elements and then returns None indefinitely.
Useful for emulating the behavior of the built
-
in map
()
function.
Useful for emulating the behavior of the built
-
in map
()
function.
"""
"""
return chain
(
seq, repeat
(
None
))
return chain
(
seq, repeat
(
None
))
...
@@ -494,7 +493,6 @@ def repeatfunc(func, times=None, *args):
...
@@ -494,7 +493,6 @@ def repeatfunc(func, times=None, *args):
"""Repeat calls to func with specified arguments.
"""Repeat calls to func with specified arguments.
Example: repeatfunc
(
random.random
)
Example: repeatfunc
(
random.random
)
"""
"""
if times is None:
if times is None:
return starmap
(
func, repeat
(
args
))
return starmap
(
func, repeat
(
args
))
...
...
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