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
0522fd81
Kaydet (Commit)
0522fd81
authored
Eki 20, 2018
tarafından
Stéphane Wirtel
Kaydeden (comit)
Julien Palard
Eki 20, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-34839: Add a 'before 3.6' in the section 'warnings' of doctest (GH-9736)
üst
a5259fb0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
doctest.rst
Doc/library/doctest.rst
+11
-7
No files found.
Doc/library/doctest.rst
Dosyayı görüntüle @
0522fd81
...
...
@@ -759,23 +759,27 @@ Warnings
:mod:`doctest` is serious about requiring exact matches in expected output. If
even a single character doesn't match, the test fails. This will probably
surprise you a few times, as you learn exactly what Python does and doesn't
guarantee about output. For example, when printing a dict, Python doesn't
guarantee that the key-value pairs will be printed in any particular order, so a
test like ::
guarantee about output. For example, when printing a set, Python doesn't
guarantee that the element is printed in any particular order, so a test like ::
>>> foo()
{"
Hermione
"
: "
hippogryph
", "
Harry
": "
broomstick
"}
{"
Hermione
"
, "
Harry
"}
is vulnerable! One workaround is to do ::
>>> foo() == {"
Hermione
"
: "
hippogryph
", "
Harry
": "
broomstick
"}
>>> foo() == {"
Hermione
"
, "
Harry
"}
True
instead. Another is to do ::
>>> d = sorted(foo()
.items()
)
>>> d = sorted(foo())
>>> d
[('Harry', 'broomstick'), ('Hermione', 'hippogryph')]
['Harry', 'Hermione']
.. note::
Before Python 3.6, when printing a dict, Python did not guarantee that
the key-value pairs was printed in any particular order.
There are others, but you get the idea.
...
...
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