john.mendelewski at gmail.com
Fri Mar 20 00:37:42 CET 2009
On Mar 19, 6:19 pm, Benjamin Peterson <benja... at python.org> wrote:
> John Mendelewski <john.mendelewski <at> gmail.com> writes:
> > I was wondering if anyone had documents or articles what gave an in-
> > depth view of the object system in Python. Ones concerning dispatch,
> > how self really works, and maybe some meta-programming that comes
> > along with the new style classes.
> What do you mean "how self really works"?
> It's just an instance of the class.
>>> class A(object):
... def do(self):
... print self.__class__, self.__class__.__bases__
>>> a = A()
<class '__main__.A'> (<type 'object'>,)
What goes on behind the scenes to make a.do() evaluate the do
method with a bound to self in that method? Is this implemented
in C, Python? I think I have a grasp of how to use objects, but
I was wondering about the implementation I suppose.
More information about the Python-list