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
9b550899
Kaydet (Commit)
9b550899
authored
Kas 27, 2014
tarafından
Ethan Furman
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue22780: reword NotImplemented docs to emphasise should
üst
0a59d556
b004943e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
constants.rst
Doc/library/constants.rst
+17
-3
numbers.rst
Doc/library/numbers.rst
+2
-0
datamodel.rst
Doc/reference/datamodel.rst
+6
-1
No files found.
Doc/library/constants.rst
Dosyayı görüntüle @
9b550899
...
...
@@ -26,9 +26,23 @@ A small number of constants live in the built-in namespace. They are:
.. data:: NotImplemented
Special value which should be returned by the special methods
(:meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, etc.) to indicate
that the operation is not implemented with respect to the other type.
Special value which should be returned by the binary special methods
(e.g. :meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, :meth:`__rsub__`,
etc.) to indicate that the operation is not implemented with respect to
the other type; may be returned by the in-place binary special methods
(e.g. :meth:`__imul__`, :meth:`__iand__`, etc.) for the same purpose.
Its truth value is true.
.. note::
When ``NotImplemented`` is returned, the interpreter will then try the
reflected operation on the other type, or some other fallback, depending
on the operator. If all attempted operations return ``NotImplemented``, the
interpreter will raise an appropriate exception.
See
:ref:`implementing-the-arithmetic-operations`
for more details.
.. data:: Ellipsis
...
...
Doc/library/numbers.rst
Dosyayı görüntüle @
9b550899
...
...
@@ -110,6 +110,8 @@ those. You can add ``MyFoo`` between :class:`Complex` and
MyFoo.register(Real)
.. _implementing-the-arithmetic-operations:
Implementing the arithmetic operations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
Doc/reference/datamodel.rst
Dosyayı görüntüle @
9b550899
...
...
@@ -154,11 +154,16 @@ NotImplemented
This type has a single value. There is a single object with this value. This
object is accessed through the built-in name ``NotImplemented``. Numeric methods
and rich comparison methods
may
return this value if they do not implement the
and rich comparison methods
should
return this value if they do not implement the
operation for the operands provided. (The interpreter will then try the
reflected operation, or some other fallback, depending on the operator.) Its
truth value is true.
See
:ref:`implementing-the-arithmetic-operations`
for more details.
Ellipsis
.. index:: object: Ellipsis
...
...
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