471,354 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Representation of new-style instance

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
1 864
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.

Similar topics

10 posts views Thread by Mantorok Redgormor | last post: by
11 posts views Thread by pemo | last post: by
26 posts views Thread by Carramba | last post: by
5 posts views Thread by anders.weitman | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.