Metaclass question

Peter Hansen peter at engcorp.com
Wed Mar 12 20:29:35 CET 2003


Bojiro Kafir Tsava wrote:
> 
> I need to achieve transparent import/instantiation of classes and modules.
> 
> Here's a summary
> 
> When I do:
> 
> import me.my.module.MyClass
> 
> should result in creation of a new python class "me.my.module.MyClass" which
> has a constructor:
> 
> class MyClass:
>     def __init__(self, *args):
>         self.extObj = extensionmodule.new(xxArg1, "MyClass")

Can you explain *why* you need it to work in exactly this way?  Better
yet, explain what you are really trying to achieve, without reference
to the specific means of achieving it which you think you need.  Doing
what you ask seems unlikely to be the simplest way of getting to the
real goal.

-Peter




More information about the Python-list mailing list