Object System

J

John Mendelewski

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.
 
B

Benjamin Peterson

John Mendelewski said:
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.
 
J

John Mendelewski

John Mendelewski <john.mendelewski <at> gmail.com> writes:




What do you mean "how self really works"?

It's just an instance of the class.

I meant:
.... def do(self):
.... print self.__class__, self.__class__.__bases__
....<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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,294
Messages
2,571,511
Members
48,202
Latest member
ClaudioVil

Latest Threads

Top