summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-02-12 16:29:05 (GMT)
committerGuido van Rossum <guido@python.org>1993-02-12 16:29:05 (GMT)
commit9e51f9bec85ac8bc167c2fb8d3956968ef8311af (patch)
tree502d6a37c21a409246c9a29a40fe0149fe7d3715 /Objects/classobject.c
parente8a3c28f8d962ca0dff6f6ad82f335706c90fa58 (diff)
downloadcpython-9e51f9bec85ac8bc167c2fb8d3956968ef8311af.zip
cpython-9e51f9bec85ac8bc167c2fb8d3956968ef8311af.tar.gz
cpython-9e51f9bec85ac8bc167c2fb8d3956968ef8311af.tar.bz2
bltinmodule.c: added round(x, [n]); coerce() of two class instances
will try to coerce anyway. classobject.c: instance 'nonzero' should first try __nonzero__ only then __len__.
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 0661e81..1e6fdb6 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -619,9 +619,9 @@ instance_nonzero(self)
object *func, *res;
long outcome;
- if ((func = instance_getattr(self, "__len__")) == NULL) {
+ if ((func = instance_getattr(self, "__nonzero__")) == NULL) {
err_clear();
- if ((func = instance_getattr(self, "__nonzero__")) == NULL) {
+ if ((func = instance_getattr(self, "__len__")) == NULL) {
err_clear();
/* Fall back to the default behavior:
all instances are nonzero */