array of class / code optimization

Jussi Salmela tiedon_jano at hotmail.com
Wed Jan 3 11:23:28 EST 2007


hg kirjoitti:
> mm wrote:
> 
>> Yes, it was the (), equivalent to thiks like new() create new object
>> from class xy.
>>>   s1.append(Word)
>> s1.append(Word())
>>
>> But I was looking for a "struct" equivalent like in c/c++.
>> And/or "union". I can't find it.
>>
>> Maybe you know a source (URL) "Python for c/c++ programmers" or things
>> like that.
>>
>>
>> Yes, I konw whats an object is...
> 
> 
> A struct in C is unrelated to a struct in C++ as a struct in C++ _is_ a
> class.
> 
> 
> hg
> 

What does your sentence mean, exactly? If I take a C file xyz.c 
containing a struct definition S, say, rename it to be xyz.cpp and feed 
it to a C++ compiler, the S sure remains a struct and the C++ compiler 
has no difficulty in handling it as a struct, so ?!?

Cheers,
Jussi



More information about the Python-list mailing list