For example I have a large class called "Writer". it has dozens of defs and they call each other. I want to move some defs to another .py file to keep the overview.
My attempt was to take some def from class "Writer" to a new file, put them there into a class called e.g. "ESwriter".
The point is that the defs in calss ESwriter in turn calls some other defs in class Writer. This compiles but when executed the other defs in calss Writer do not return anything.
An example:
Code: Select all
class ESwriter:
def init(self, solver, directory):
self.solver = solver
self.directory = directory
self.write = writer.Writer(self.solver, self.directory)
def _handleElectrostaticConstants(self):
self.write._constant(
"Permittivity Of Vacuum",
self.write._convert(self.write.constsdef["PermittivityOfVacuum"], "T^4*I^2/(L^3*M)")
)
Code: Select all
ESW = test.ESwriter(self.solver, self.directory)
ESW._handleElectrostaticConstants()