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
9609cea0
Kaydet (Commit)
9609cea0
authored
Eyl 09, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#3803: fix docs for comparison of unequal types.
üst
7cd67cc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
expressions.rst
Doc/reference/expressions.rst
+7
-10
No files found.
Doc/reference/expressions.rst
Dosyayı görüntüle @
9609cea0
...
@@ -1003,16 +1003,13 @@ pretty).
...
@@ -1003,16 +1003,13 @@ pretty).
The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the
The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the
values of two objects. The objects need not have the same type. If both are
values of two objects. The objects need not have the same type. If both are
numbers, they are converted to a common type. Otherwise, objects of different
numbers, they are converted to a common type. Otherwise, the ``==`` and ``!=``
types *always* compare unequal, and are ordered consistently but arbitrarily.
operators *always* consider objects of different types to be unequal, while the
You can control comparison behavior of objects of non-builtin types by defining
``<``, ``>``, ``>=`` and ``<=`` operators raise a :exc:`TypeError` when
a :meth:`__cmp__` method or rich comparison methods like :meth:`__gt__`,
comparing objects of different types that do not implement these operators for
described in section :ref:`specialnames`.
the given pair of types. You can control comparison behavior of objects of
non-builtin types by defining rich comparison methods like :meth:`__gt__`,
(This unusual definition of comparison was used to simplify the definition of
described in section :ref:`customization`.
operations like sorting and the :keyword:`in` and :keyword:`not in` operators.
In the future, the comparison rules for objects of different types are likely to
change.)
Comparison of objects of the same type depends on the type:
Comparison of objects of the same type depends on the type:
...
...
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