@@ -269,7 +269,7 @@ x and y if x is False then x, else (1)
269269
270270Notes :
271271 Truth testing behavior can be overridden for a given class by defining
272- special method __nonzero__ .
272+ special method __bool__ .
273273 (1) Evaluate second arg only if necessary to determine outcome.
274274
275275None
@@ -1143,7 +1143,7 @@ Special methods for any class
11431143 __cmp__(s, o) Compares s to o and returns <0, 0, or >0.
11441144 Implements >, <, == etc...
11451145 __hash__(s) Compute a 32 bit hash code; hash() and dictionary ops
1146- __nonzero__ (s) Returns False or True for truth value testing
1146+ __bool__ (s) Returns False or True for truth value testing
11471147 __getattr__(s, name) called when attr lookup doesn't find <name>
11481148 __setattr__(s, name, val) called when setting an attr
11491149 (inside, don't use "self.name = value"
@@ -1167,7 +1167,7 @@ Operators
11671167 s&o = __and__(s,o)
11681168 s^o = __xor__(s,o) s|o = __or__(s,o)
11691169 s<<o = __lshift__(s,o) s>>o = __rshift__(s,o)
1170- nonzero (s) = __nonzero__ (s) (used in boolean testing)
1170+ bool (s) = __bool__ (s) (used in boolean testing)
11711171 -s = __neg__(s) +s = __pos__(s)
11721172 abs(s) = __abs__(s) ~s = __invert__(s) (bitwise)
11731173 s+=o = __iadd__(s,o) s-=o = __isub__(s,o)
0 commit comments