473,387 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 900
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Mantorok Redgormor | last post by:
I always see posts that involve the representation of integers, where some poster claims that the unerlyding representation of an integer doesn't have to reflect on the actual integer, for example:...
11
by: pemo | last post by:
Ambiguous? I have a student who's asked me to explain the following std text (esp. the footnote). 6.2.6.1.5 Certain object representations need not represent a value of the object type. If...
26
by: Carramba | last post by:
Hi! How can I output value of char or int in binary form with printf(); ? thanx in advance
0
by: OscarPiacenza | last post by:
Hello all. :) My name is Oscar and I’m a novice on XML and dataset arguments. I need some help to resolve (and understand :) ) the following problem: I have stored some data in a SqlServer...
5
by: anders.weitman | last post by:
Hi! I want to get the representation in memory of a variable of type double and put it in an array of four unsigned short int (I'm on a 32- bits Windows architecture so a double is 64-bits and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.