Unpythonic? Impossible??

Erik Max Francis max at alcyone.com
Sun Mar 19 18:07:10 EST 2006


BrJohan wrote:

> I know how to use a class factory - and could work around using such a 
> mechanism. However I am interested to know if I could let the classes do the 
> work by themselves.

You can, but a class factory is going to be much clearer and probably 
more maintainable.  From the user's perspective, there's no difference 
from calling a class A to instantiate it, and calling a factory function 
called A that selects the appropriate class and returns an instance of it.

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   Never had very much to say / Laugh last, laugh longest
   -- Des'ree



More information about the Python-list mailing list