Super is a problem when a class is using multiple inheritance. But you
aren't using multiple inheritance here.

I would recommend to stop using reload() here. When you reload one module
it will leave other interdependent modules in conflicting states. As you
have identified, the memory address is changing because the reload creates
another copy of all the contents in the module. This means the other
modules can have old references. The C class may end up having a bad
reference if the B class gets redefined. If you really need this reload
functionality (which should not be left in place for a production deploy)
then you could search for a "deep reload" solution online. This would at
least reload everything related to what you are reloading. Or, you could
remove the reloads from the modules and just manually reload in the right
order as needed:

reload(A)
reload(B)
reload(C)


On Tue, Aug 14, 2018, 7:03 AM Rudi Hammad <rudiham...@gmail.com> wrote:

>
> By the way, I have printed out the adress of  moduleB.ClassB in
> moduleC1.py and moduleC2.py.
> Because I have added reload(moduleB) in each module, that reload is
> changing the adress of the class moduleB.ClassB, so when I do the second
> time classC1 = moduleC1.ClassC1("foo")
> there is nothing there because the adress changed. So I get that error. Is
> that correct?
>
> Still, I am not sure of to design the code to keep that class "tree"
> mentioned before. I need the reload to update my progress to the
> subclasses, but by doing so,
> the memory address changes.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/ee76aacf-2e05-471a-9029-56bb3f292194%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/ee76aacf-2e05-471a-9029-56bb3f292194%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2orO8nwdkQ88G4V4BqGAswQFe_mKqoEjrD1%3D9v5gP%3D0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to