On 8/19/07, James Stroud <[EMAIL PROTECTED]> wrote:
> This was the poor design I was hinting to. do_foobar is type-checking
> for ticker. "Casting" as you might think of it does not exist in python.
> Creating new objects based on the values of existing objects (lets call
> it "conversion" for lack
JoeSox wrote:
> On 8/19/07, James Stroud <[EMAIL PROTECTED]> wrote:
>> Quick and dirty (you could also use a try: except:):
>>
>> f = __import__(module_name)
>> for anobj in f.__dict__.values():
>> if hasattr(anobj, 'do_foobar'):
>> anobj.do_foobar()
>>
>> Note that this does not test whether
On 8/19/07, James Stroud <[EMAIL PROTECTED]> wrote:
> Quick and dirty (you could also use a try: except:):
>
> f = __import__(module_name)
> for anobj in f.__dict__.values():
> if hasattr(anobj, 'do_foobar'):
> anobj.do_foobar()
>
> Note that this does not test whether anobj is a class as thi
JoeSox wrote:
> I am importing 3rd party modules via a plugin script. I wish to
> iterate thru the modules and call a common method like .do_foobar() or
> something with all the imports.
> But I can't figure out how to do something like below without knowing
> the class name before hand. Is there
I am importing 3rd party modules via a plugin script. I wish to
iterate thru the modules and call a common method like .do_foobar() or
something with all the imports.
But I can't figure out how to do something like below without knowing
the class name before hand. Is there a builtin that helps cal
Thanks for your help.
After trying your suggestion for a while, I eventually realised that
SQLObject was doing something funny in its metaclass that was causing the
issue, which I got around by mangling the class names with a counter.
--
http://mail.python.org/mailman/listinfo/python-list
Lachlan Gunn a écrit :
> Hello.
>
> I have a library (SQLObject) that stores data as class variables. I would
> like to set a class variable in a certain context, specific to a certain
> instance of an object. This would require some sort of anonymous class. I
> have attempted to use the follow
Hello.
I have a library (SQLObject) that stores data as class variables. I would
like to set a class variable in a certain context, specific to a certain
instance of an object. This would require some sort of anonymous class. I
have attempted to use the following code to set the connection stri