dsw> New problem though. On line:
dsw> newclass = new.classobj(classname + '_' + food, (mixin, main), {})
dsw> received "TypeError: metaclass conflict: the metaclass of a
dsw> derived class must be a (non-strict) subclass of the
dsw> metaclasses of all its bases".
Oops, goofed up on me. The above
Yup, Got it.
New problem though. On line:
newclass = new.classobj(classname + '_' + food, (mixin, main), {})
received "TypeError: metaclass conflict: the metaclass of a
derived class must be a (non-strict) subclass of the
metaclasses of all its bases". This had not happened when
was written usin
dody suria wijaya wrote:
> "import a" inside b would not solve the problem, since there
> are many "module a" and module b does not know beforehand
> which module had imported it.
Ok, I understand now what you are trying to achieve, but there isn't any
concept relating a module back to the first
Thank you for such a quick reply. There were some details I
had left behind related to my case that I guess would now
need to be told to better illustrate the problem.
I have many different module of "a", let's called it a1, a2 ...
a100, and there is only one module "b". Here's a better
example (a
dody suria wijaya wrote:
>
> I found this problem when trying to split a module into two.
> Here's an example:
>
>==
> #Module a (a.py):
> from b import *
> class Main: pass
>==
>
>==
> #Module b (b.py)
> def How():
> Main_instance = module_a.Main()
>
I found this problem when trying to split a module into two.
Here's an example:
==
#Module a (a.py):
from b import *
class Main: pass
==
==
#Module b (b.py)
def How():
Main_instance = module_a.Main()
return Main_instance
==
> import a
> a.