Open PythonCHB opened 6 years ago
WE should have classmethod in there.
And then add a sphere subclass, which add volume, and removes area, and overrides str and repr, but gets everything else.
A demo of how classmethods (and everything else) work properly with subclasses.
hmm -- maybe a tiny bit better using mixins? i.e. a sphere is not a a circle,but they both have a radius and diameter. -- hmm...
WE should have classmethod in there.
And then add a sphere subclass, which add volume, and removes area, and overrides str and repr, but gets everything else.
A demo of how classmethods (and everything else) work properly with subclasses.
hmm -- maybe a tiny bit better using mixins? i.e. a sphere is not a a circle,but they both have a radius and diameter. -- hmm...