Ron Garret wrote:
In article <[EMAIL PROTECTED]>,
Steven Bethard <[EMAIL PROTECTED]> wrote:
Why don't you just write a function to create class objects?
def f(*params):
class C(...):
... # based on params
return C
I suppose I could. When I originally started writing this code I w
In article <[EMAIL PROTECTED]>,
Steven Bethard <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > I need to dynamically generate new types at run time. I can do this in
> > two ways. I can use the "type" constructor, or I can generate a "class"
> > statement as a string and feed that to the e
In article <[EMAIL PROTECTED]>,
Leif K-Brooks <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > I need to dynamically generate new types at run time. I can do this in
> > two ways. I can use the "type" constructor, or I can generate a "class"
> > statement as a string and feed that to the ex
Ron Garret wrote:
I need to dynamically generate new types at run time. I can do this in
two ways. I can use the "type" constructor, or I can generate a "class"
statement as a string and feed that to the exec function. The former
technique is much cleaner all else being equal, but I want to b
[Ron Garret]
> Is it really impossible to specify __slots__ using the "type"
> constructor?
It does not work? I vaguely remember having needed to do this once or
twice, and it worked immediatly as expected. Unless I remember wrongly,
you only have to preset `__slots__' in the dict you give to `
Ron Garret wrote:
I need to dynamically generate new types at run time. I can do this in
two ways. I can use the "type" constructor, or I can generate a "class"
statement as a string and feed that to the exec function. The former
technique is much cleaner all else being equal, but I want to b
Ron Garret wrote:
>
> I need to dynamically generate new types at run time. I can do this in
> two ways. I can use the "type" constructor, or I can generate a "class"
> statement as a string and feed that to the exec function. The former
> technique is much cleaner all else being equal, but I
I need to dynamically generate new types at run time. I can do this in
two ways. I can use the "type" constructor, or I can generate a "class"
statement as a string and feed that to the exec function. The former
technique is much cleaner all else being equal, but I want to be able to
specif