array of class / code optimization

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at
Wed Jan 3 20:05:40 CET 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):

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++.



BOFH excuse #344:

Network failure -  call NBC

More information about the Python-list mailing list