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
caa1280d
Kaydet (Commit)
caa1280d
authored
Tem 29, 2017
tarafından
Peter Thomassen
Kaydeden (comit)
Terry Jan Reedy
Tem 29, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-30803: clarify truth value testing documentation (#2508)
Initial patch by Peter Thomassen.
üst
ceb93f45
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
19 deletions
+15
-19
stdtypes.rst
Doc/library/stdtypes.rst
+14
-19
2017-07-29-14-55-50.bpo-30803.6hutqQ.rst
...xt/Documentation/2017-07-29-14-55-50.bpo-30803.6hutqQ.rst
+1
-0
No files found.
Doc/library/stdtypes.rst
Dosyayı görüntüle @
caa1280d
...
@@ -39,31 +39,26 @@ Truth Value Testing
...
@@ -39,31 +39,26 @@ Truth Value Testing
single: false
single: false
Any object can be tested for truth value, for use in an :keyword:`if` or
Any object can be tested for truth value, for use in an :keyword:`if` or
:keyword:`while` condition or as operand of the Boolean operations below. The
:keyword:`while` condition or as operand of the Boolean operations below.
following values are considered false:
.. index:: single: None (Built-in object)
.. index:: single: true
* ``None``
.. index:: single: False (Built-in object)
* ``False``
* zero of any numeric type, for example, ``0``, ``0.0``, ``0j``.
* any empty sequence, for example, ``''``, ``()``, ``[]``.
By default, an object is considered true unless its class defines either a
:meth:`__bool__` method that returns ``False`` or a :meth:`__len__` method that
returns zero, when called with the object. [1]_ Here are most of the built-in
objects considered false:
* any empty mapping, for example, ``{}``.
.. index::
single: None (Built-in object)
single: False (Built-in object)
* instances of user-defined classes, if the class defines a :meth:`__bool__` or
* constants defined to be false: ``None`` and ``False``.
:meth:`__len__` method, when that method returns the integer zero or
:class:`bool` value ``False``. [1]_
.. index:: single: true
* zero of any numeric type: ``0``, ``0.0``, ``0j``, ``Decimal(0)``,
``Fraction(0, 1)``
All other values are considered true --- so objects of many types are always
* empty sequences and collections: ``''``, ``()``, ``[]``, ``{}``, ``set()``,
true.
``range(0)``
.. index::
.. index::
operator: or
operator: or
...
...
Misc/NEWS.d/next/Documentation/2017-07-29-14-55-50.bpo-30803.6hutqQ.rst
0 → 100644
Dosyayı görüntüle @
caa1280d
Clarify doc on truth value testing. Original patch by Peter Thomassen.
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