array of class / code optimization

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Wed Jan 3 14:05:40 EST 2007


mm wrote:

> But I was looking for a "struct" equivalent like in c/c++.
> And/or "union". I can't find it.

class Honk(object):
    pass

test = Honk()
test.spam = 4
test.eggs = "Yum"

Is it this what you're looking for?

> Maybe you know a source (URL) "Python for c/c++ programmers" or
> things like that.

Have a look at "Learning Python" by Mark Lutz and David Ascher. I
found it very helpful because they often refer to C/C++.

Regards,


Björn

-- 
BOFH excuse #344:

Network failure -  call NBC




More information about the Python-list mailing list