dynamic

Michele Simionato michele.simionato at gmail.com
Thu Jun 16 07:01:48 CEST 2005


Yes, factory methods, exactly. If I had a base class ImageReader with
children JpegReader and TIFFReader, I will probably add two factory
methods ImageReader.makeJpegReader and ImageReader.makeTIFFReader, I
will not override ImageReader.__new__
to return sometimes JpegReader instances and sometimes TIFFReader
instances. Explicit is better than implicit and all that.

              Michele Simionato




More information about the Python-list mailing list