Commit a85c12d4 authored by Jim Fulton's avatar Jim Fulton

Added __class__ attribute on classes.

parent 7a156d59
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE. DAMAGE.
$Id: ExtensionClass.c,v 1.32 1999/02/19 20:52:23 jim Exp $ $Id: ExtensionClass.c,v 1.33 1999/05/12 15:49:55 jim Exp $
If you have questions regarding this software, If you have questions regarding this software,
contact: contact:
...@@ -54,7 +54,7 @@ static char ExtensionClass_module_documentation[] = ...@@ -54,7 +54,7 @@ static char ExtensionClass_module_documentation[] =
" - They provide access to unbound methods,\n" " - They provide access to unbound methods,\n"
" - They can be called to create instances.\n" " - They can be called to create instances.\n"
"\n" "\n"
"$Id: ExtensionClass.c,v 1.32 1999/02/19 20:52:23 jim Exp $\n" "$Id: ExtensionClass.c,v 1.33 1999/05/12 15:49:55 jim Exp $\n"
; ;
#include <stdio.h> #include <stdio.h>
...@@ -1773,6 +1773,13 @@ CCL_getattro(PyExtensionClass *self, PyObject *name) ...@@ -1773,6 +1773,13 @@ CCL_getattro(PyExtensionClass *self, PyObject *name)
return self->class_dictionary; return self->class_dictionary;
} }
break; break;
case 'c':
if (strcmp(n,"class__")==0)
{
Py_INCREF(self->ob_type);
return OBJECT(self->ob_type);
}
break;
} }
} }
} }
...@@ -3391,7 +3398,7 @@ void ...@@ -3391,7 +3398,7 @@ void
initExtensionClass() initExtensionClass()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.32 $"; char *rev="$Revision: 1.33 $";
PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL); PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL);
PMethodType.ob_type=&PyType_Type; PMethodType.ob_type=&PyType_Type;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE. DAMAGE.
$Id: ExtensionClass.c,v 1.32 1999/02/19 20:52:23 jim Exp $ $Id: ExtensionClass.c,v 1.33 1999/05/12 15:49:55 jim Exp $
If you have questions regarding this software, If you have questions regarding this software,
contact: contact:
...@@ -54,7 +54,7 @@ static char ExtensionClass_module_documentation[] = ...@@ -54,7 +54,7 @@ static char ExtensionClass_module_documentation[] =
" - They provide access to unbound methods,\n" " - They provide access to unbound methods,\n"
" - They can be called to create instances.\n" " - They can be called to create instances.\n"
"\n" "\n"
"$Id: ExtensionClass.c,v 1.32 1999/02/19 20:52:23 jim Exp $\n" "$Id: ExtensionClass.c,v 1.33 1999/05/12 15:49:55 jim Exp $\n"
; ;
#include <stdio.h> #include <stdio.h>
...@@ -1773,6 +1773,13 @@ CCL_getattro(PyExtensionClass *self, PyObject *name) ...@@ -1773,6 +1773,13 @@ CCL_getattro(PyExtensionClass *self, PyObject *name)
return self->class_dictionary; return self->class_dictionary;
} }
break; break;
case 'c':
if (strcmp(n,"class__")==0)
{
Py_INCREF(self->ob_type);
return OBJECT(self->ob_type);
}
break;
} }
} }
} }
...@@ -3391,7 +3398,7 @@ void ...@@ -3391,7 +3398,7 @@ void
initExtensionClass() initExtensionClass()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.32 $"; char *rev="$Revision: 1.33 $";
PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL); PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL);
PMethodType.ob_type=&PyType_Type; PMethodType.ob_type=&PyType_Type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment