Thorsten Kampe wrote:

>> def GenericDict(dict_or_items):
>>     if isinstance(dict_or_items, dict):
>>         return dict(dict_or_items)
>>     else:
>>         return SimpleGenericDictWithOnlyTheFalseBranchesImplemented(
>>             dict_or_items
>>         )
> 
> That would be a kind of factory function for the class?

Yes, one if...else to pick a dedicated class instead of one if...else per 
method in the all-things-to-all-people class.


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to