Kaydet (Commit) fe7c26d9 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

mention how to override boolean evaluation

üst 3e876fd1
...@@ -1143,7 +1143,8 @@ In the context of Boolean operations, and also when expressions are used by ...@@ -1143,7 +1143,8 @@ In the context of Boolean operations, and also when expressions are used by
control flow statements, the following values are interpreted as false: control flow statements, the following values are interpreted as false:
``False``, ``None``, numeric zero of all types, and empty strings and containers ``False``, ``None``, numeric zero of all types, and empty strings and containers
(including strings, tuples, lists, dictionaries, sets and frozensets). All (including strings, tuples, lists, dictionaries, sets and frozensets). All
other values are interpreted as true. other values are interpreted as true. (See the :meth:`~object.__nonzero__`
special method for a way to change this.)
.. index:: operator: not .. index:: operator: not
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment