[Tutor] Concept related to python classes
David Rock
david at graniteweb.com
Mon Sep 7 16:52:31 EDT 2020
* Richard Damon <Richard at Damon-Family.org> [2020-09-07 16:48]:
>
> There is also the suggestion I have heard that a class with two methods,
> one being __init__, and one computing a result is often better as just a
> function (unless you need the object as a scratch pad for some reason)
That may be, but doing it as a class allows for easy expansion. What happens
when calculating the perimeter becomes necessary? If it's a class, the
framework is already there.
--
David Rock
david at graniteweb.com
More information about the Tutor
mailing list