[Tutor] Re: Re: Factory classes (etc)
alan.gauld@bt.com
alan.gauld@bt.com
Fri, 6 Sep 2002 17:26:09 +0100
> But in most cases where you use overloading or templates in
> C++ etc, you just write one method in Python, and that's it! :)
> Perhaps you need an extra if-statement in the method, but I
> have never missed method overloading in Python during the six
> years I used it.
I agree. Although I posted a solution a few days ago, mostly
you just write the code such that you don't care what types
get passed in. When you combine that with default arguments
and keyword arguments there is hardly ever a real need for
overloading.
Controlling a class explosion (which was Arthurs problem) is
better handled by one or more class factories operating at
the appropriate level of abstraction - shape say in his case...
Alan g.