I'm just an egg. ,, Maybe this is obvious to non-beginners, but I need an idiom from some.package.module import module .
I had to change one GenerallyHelpfulClass method. This failed:
import some.package.module class SpeciallyHelpfulClass(some.package.module.GenerallyHelpfulClass): def general_method(self):... some.package.module.GenerallyHelpfulClass = SpeciallyHelpfulClass
The code worked, but did not use behavior overloaded by SpeciallyHelpfulClass.
This worked:
from some.package import module class SpeciallyHelpfulClass(module.GenerallyHelpfulClass): def general_method(self):... module.GenerallyHelpfulClass = SpeciallyHelpfulClass
I assume that from ... import idiom 'gets a module', as Alex wrote, as it will be picked up by other modules in the package. Further, a longer dashed link appears to bring the module into the namespace with import over the long dashed link, but does not change the module used by other namespaces. Thus, changes in the import module will be displayed only in the namespace where they were made. It is as if there were two copies of the same module, each of which was available under several different links.
chernevik Oct 20 2018-11-11T00: 00Z
source share