diff Python/compile.c @ 1289:4d292c7857d4 legacy-trunk

Access checks now work, at least for instance data (not for methods yet). The class is now passed to eval_code and stored in the current frame. It is also stored in instance method objects. An "unbound" instance method is now returned when a function is retrieved through "classname.funcname", which when called passes the class to eval_code.
author Guido van Rossum <guido@python.org>
date Thu, 20 May 1993 14:24:46 +0000
parents 9fed5726a36d
children cd397266dc1c
line wrap: on
line diff
--- a/Python/compile.c	Wed May 19 14:50:45 1993 +0000
+++ b/Python/compile.c	Thu May 20 14:24:46 1993 +0000
@@ -1429,8 +1429,8 @@
 	/* Calculate the mode mask */
 	mode = 0;
 	for (j = i; j < NCH(n); j += 2) {
-		int r=0,w=0,p=0;
-		for (k=0; k<NCH(CHILD(n,j)); k++) {
+		int r = 0, w = 0, p = 0;
+		for (k = 0; k < NCH(CHILD(n,j)); k++) {
 			if (strequ(STR(CHILD(CHILD(n,j),k)), "public"))
 				p = 0;
 			else if (strequ(STR(CHILD(CHILD(n,j),k)), "protected"))
@@ -1446,7 +1446,7 @@
 					STR(CHILD(CHILD(n,j),k)));
 		}
 		if (r == 0 && w == 0)
-			r =w = 1;
+			r = w = 1;
 		if (p == 0) {
 			if (r == 1) mode |= AC_R_PUBLIC;
 			if (w == 1) mode |= AC_W_PUBLIC;