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 fu

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"

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 li

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

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)

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

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