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
9b1e92f5
Kaydet (Commit)
9b1e92f5
authored
Eki 28, 2014
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#22237: document that sorted() is guaranteed to be stable. Initial patch by Martin Panter.
üst
16e7f97b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
functions.rst
Doc/library/functions.rst
+5
-0
heapq.rst
Doc/library/heapq.rst
+3
-1
No files found.
Doc/library/functions.rst
Dosyayı görüntüle @
9b1e92f5
...
...
@@ -1286,6 +1286,11 @@ are always available. They are listed here in alphabetical order.
Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a
*key* function.
The built-in :func:`sorted` function is guaranteed to be stable. A sort is
stable if it guarantees not to change the relative order of elements that
compare equal --- this is helpful for sorting in multiple passes (for
example, sort by department, then by salary grade).
For sorting examples and a brief sorting tutorial, see `Sorting HowTo
<http://wiki.python.org/moin/HowTo/Sorting/>`_\.
...
...
Doc/library/heapq.rst
Dosyayı görüntüle @
9b1e92f5
...
...
@@ -123,7 +123,6 @@ pushing all values onto a heap and then popping off the smallest values one at a
time::
>>> def heapsort(iterable):
... 'Equivalent to sorted(iterable)'
... h = []
... for value in iterable:
... heappush(h, value)
...
...
@@ -132,6 +131,9 @@ time::
>>> heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
This is similar to ``sorted(iterable)``, but unlike :func:`sorted`, this
implementation is not stable.
Heap elements can be tuples. This is useful for assigning comparison values
(such as task priorities) alongside the main record being tracked::
...
...
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