[merge] Registry
Martin Pool
mbp at canonical.com
Thu Oct 12 09:29:21 BST 2006
On 11 Oct 2006, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
> It seems like it would be very, very common to do
>
> obj = registry.get(key)(arg1, arg2, ...)
>
> Is it worth supporting this explicitly?
Maybe, but yagni for now I think.
> I'm a little uncomfortable with the 'info' idea. It seems like, for a
> given registry, you'd want to have the same 'info' about all registered
> objects. If you were registering Commands, you might want to register
> aliases, parameters, options, and help. Whatever you registered, you'd
> want it to be consistent. Wouldn't it be better for a each registry to
> have its own Info type?
or, alternatively, have a subclass
class CommandRegistry(Registry):
def get_command_parameters(self, command_name):
return self.get_info(command_name)['parameters']
# or
return self.get_info(command_name).parameters
--
Martin
More information about the bazaar
mailing list