"my brain hurts" or is isinstance broken?

Martin v. Löwis loewis at informatik.hu-berlin.de
Thu Jul 4 05:56:30 EDT 2002


robert_kuzelj at yahoo.com (Robert Kuzelj) writes:

> one could imagine an object that is a mix between a factory and
> a prototyperegistry.
> 
> class ProtoFactory:
>    def __init__(self):
>       self.SourceObjects = {}
>    def register(self, name, source):
>       self.SourceObjects[name] = source

Explicit is better then implicit. There should be two functions:
register_factory, and register_prototype. It would be reasonable to
pass functions to such a registry as well, which then typically
qualify as factories.

Regards,
Martin



More information about the Python-list mailing list