[Zope-Checkins] CVS: Zope3/lib/python/Zope/ContextWrapper - wrapper.c:1.12.2.11

Fred L. Drake, Jr. fdrake@acm.org
Wed, 20 Mar 2002 11:44:23 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/ContextWrapper
In directory cvs.zope.org:/tmp/cvs-serv10206

Modified Files:
      Tag: Zope-3x-branch
	wrapper.c 
Log Message:
Explain why the commented-out version of wrap_getattro() works how it does.

=== Zope3/lib/python/Zope/ContextWrapper/wrapper.c 1.12.2.10 => 1.12.2.11 ===
     PyObject *result;
     /*
+      This commented-out version allows subclasses of the Wrapper type
+      to add new attributes.  To do so and still make __class__ still
+      evaluate to the __class__ of the wrapped object, we have to
+      special case that attribute.  There may need to be other
+      special-cased attributes as well, which introduces Deep
+      Questions.
+     */
+    /*
     char *s = PyString_AS_STRING(name);
     if (s[0] == '_' && strcmp(s, "__class__") == 0) {
         result = (PyObject *)(Wrapper_GetObject(self)->ob_type);