diff Objects/classobject.c @ 1215:9d6cf529bb71 legacy-trunk

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__.
author Guido van Rossum <guido@python.org>
date Fri, 12 Feb 1993 16:29:05 +0000
parents ce718457b172
children c4cd0d9d8281
line wrap: on
line diff
--- a/Objects/classobject.c	Wed Feb 10 14:10:56 1993 +0000
+++ b/Objects/classobject.c	Fri Feb 12 16:29:05 1993 +0000
@@ -619,9 +619,9 @@
 	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 */