Re: array of class / code optimization

2007-01-04 Thread Bruno Desthuilliers
mm a écrit : Yes, it was the (), equivalent to thiks like new() create new object from class xy. Yeps. In Python there's no 'new' operator. Instead, classes are themselves 'callable' objects, acting as instance factory. It's very handy since it let's you replace a class with a factory

Re: array of class / code optimization

2007-01-03 Thread mm
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.

Re: array of class / code optimization

2007-01-03 Thread hg
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

Re: array of class / code optimization

2007-01-03 Thread Jussi Salmela
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++

Re: array of class / code optimization

2007-01-03 Thread Neil Cerutti
On 2007-01-03, Jussi Salmela [EMAIL PROTECTED] wrote: 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.

Re: array of class / code optimization

2007-01-03 Thread Bjoern Schliessmann
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.

Re: array of class / code optimization

2007-01-03 Thread hg
Neil Cerutti wrote: On 2007-01-03, Jussi Salmela [EMAIL PROTECTED] wrote: 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