A slight variant is to dispatch on the init:

class MyThing(object):

def __init__(self, **kwarg):
s = kwarg['source']:
if s == 'db':
self._init_db(**kwarg)
elif s == 'json':
self._init_sson(**kwarg)
else:
raise ValueError("invalid source")

def _init_db(self, **kwarg):
pass

def _init_json(self, **kwarg):
pass

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to