While writing the constructor for class A
in Python, I calculate some of the class’s fields using function fun()
. This function is never used outside the constructor of instances of this class.
In situations like these, I tend to write fun()
so that it returns the desired values and then I assign these values in the initialization, li..