class NotFoundError(Exception):
pass
class MaClasse:
class MaClasseDeux:
binding = dict(un=MaClasse, deux=MaClasseDeux)
def ma_factory(key):
if key in binding:
return binding[key]()
else:
return NotFoundError("keskece?")