By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,715 Members | 768 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,715 IT Pros & Developers. It's quick & easy.

Representation of new-style instance

P: n/a
Consider a new-style class

class rabbit(object):
def __init__(self,c):
self.color = c

r1=rabbit("blue")
r2=rabbit("purple")

Which C struct in the Python implementation is used to represent the
instances c1 and c2 of the
new-style class? I understand that when the class 'rabbit' is
created, the type_new function
in typeobject.c creates a copy of a 'struct typeobject' with
dictionary tp_dict appropriately modified.

However, I can't figure out which structure is used for new-style
instances and where the instance dictionary is stored. Could anyone
please clarify?

Thanks
Raj
Aug 1 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Raj B wrote:
Which C struct in the Python implementation is used to represent
the instances c1 and c2 of the new-style class?
You don't try to send this raw over some stream connection, do you?

Regards,
Björn

--
BOFH excuse #349:

Stray Alpha Particles from memory packaging caused Hard Memory Error
on Server.

Aug 2 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.