[Zope-dev] make zope.component.registry.Components inherit from dict?

Matthew Wilkes matthew at matthewwilkes.co.uk
Mon Nov 23 22:41:33 EST 2009


Hi Chris,

On 2009-11-24, at 0324, Chris McDonough wrote:

> In repoze.bfg, we've actually decided to use a subclass of the  
> component
> registry which also inherits from "dict".  This makes it possible to  
> spell
> common unnamed "utility" registrations and lookups as:
>
> utility = SomeUtilityImplementation()
> registry['someutility'] = utility

While I'm all for simplification, this makes very little sense to me.   
If this is an unnamed registration why is there a name ('someutility')  
involved?

If it was a named registration against Interface, or if the key was an  
interface/dotted name that'd make sense.

Could you expand on what the key is supposed to represent?

Matt


More information about the Zope-Dev mailing list