Re: [Zope-dev] Testrunner option for running tests in random order?!?

2009-11-23 Thread Jonathan Ballet
Hello, On Tue, Nov 3, 2009 at 11:21 AM, Jonathan Ballet jonathan.bal...@securactive.net wrote: Hello Christian, On Tue, Nov 3, 2009 at 11:07 AM, Christian Theune c...@gocept.com wrote: [...] btw: do you log the seed if you generated one?) Yep, the seed is displayed at the end of tests, so

[Zope-dev] Zope Tests: 6 OK

2009-11-23 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list. Period Sun Nov 22 12:00:00 2009 UTC to Mon Nov 23 12:00:00 2009 UTC. There were 6 messages: 6 from Zope Tests. Tests passed OK --- Subject: OK : Zope-2.10 Python-2.4.6 : Linux From: Zope Tests Date: Sun Nov 22 20:38:38 EST 2009 URL:

Re: [Zope-dev] Testrunner option for running tests in random order?!?

2009-11-23 Thread Christian Theune
Hi there, On 11/23/2009 10:27 AM, Jonathan Ballet wrote: Hello, On Tue, Nov 3, 2009 at 11:21 AM, Jonathan Ballet jonathan.bal...@securactive.net wrote: Hello Christian, On Tue, Nov 3, 2009 at 11:07 AM, Christian Theunec...@gocept.com wrote: [...] btw: do you log the seed if you

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

2009-11-23 Thread Chris McDonough
We've been handling some constructive criticisms from repoze.bfg developers with respect to verbosity resulting from use of unnamed utility registrations in a component architecture registry. These criticisms, and our ameliorations are detailed here:

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

2009-11-23 Thread Matthew Wilkes
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 =

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

2009-11-23 Thread Chris McDonough
Matthew Wilkes wrote: 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

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

2009-11-23 Thread Matthew Wilkes
You may have Zope Component Developer's Eyes, a common disease in these parts. ;-) The goggles, they do nothing. Under the hood, the system does something like this when a root factory needs to be registered: from repoze.bfg.interfaces import IRootFactory from zope.component import

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

2009-11-23 Thread Martin Aspeli
Hi Chris, 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 I

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

2009-11-23 Thread Martin Aspeli
Matthew Wilkes wrote: Right, but I think mixing the two is just going to be confusing. Your alternative spelling may well be useful, but only if it works within the confines of the ZCA itself, otherwise you're just hijacking the component root for your own (nefarious) purposes. The

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

2009-11-23 Thread Chris McDonough
Matthew Wilkes wrote: In a system like this, there are no interfaces; the string 'root_factory' performs the same job as the IRootFactory interface for registration and lookup. I'd like to make the ZCA registry operate like this. There's really no reason for there to be an interface

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

2009-11-23 Thread Martin Aspeli
Chris McDonough wrote: A lookup keyed entirely on strings and not interfaces is perfectly possible using the ZCA, just register your utility to provide z.i.Interface and name it. Your semantics are the same as the simple dictionary use-case, but it doesn't force people to choose one means

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

2009-11-23 Thread Chris McDonough
Martin Aspeli wrote: We need to make sure that we're not inventing a different way to achieve something which is already possible. This will lead to confusion, because people will have to know which way is applicable in a given situation, and the distinction will seem arbitrary. I fear we

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

2009-11-23 Thread Chris McDonough
Chris McDonough wrote: Off the top of my head, another way to think of this *might* be to say that the 'dict access' is basically looking up a *named* utility providing a very generic marker interface, e.g. zope.component.interfaces.IUtility or even just zope.interface.Interface. That

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

2009-11-23 Thread Martin Aspeli
Hi Chris, Chris McDonough wrote: Martin Aspeli wrote: We need to make sure that we're not inventing a different way to achieve something which is already possible. This will lead to confusion, because people will have to know which way is applicable in a given situation, and the

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

2009-11-23 Thread Matthew Wilkes
On 2009-11-24, at 0521, Chris McDonough wrote: I don't think I understand. Could you provide an example? Sure! I think this is the same thing that Martin suggested, but here's some code which should make it clearer. First, we create an object that we want to be accessible from this

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

2009-11-23 Thread Martin Aspeli
Chris McDonough wrote: Chris McDonough wrote: Off the top of my head, another way to think of this *might* be to say that the 'dict access' is basically looking up a *named* utility providing a very generic marker interface, e.g. zope.component.interfaces.IUtility or even just

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

2009-11-23 Thread Chris McDonough
Martin Aspeli wrote: Hi Chris, Chris McDonough wrote: Martin Aspeli wrote: We need to make sure that we're not inventing a different way to achieve something which is already possible. This will lead to confusion, because people will have to know which way is applicable in a given

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

2009-11-23 Thread Chris McDonough
Matthew Wilkes wrote: On 2009-11-24, at 0521, Chris McDonough wrote: I don't think I understand. Could you provide an example? Sure! I think this is the same thing that Martin suggested, but here's some code which should make it clearer. First, we create an object that we want to

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

2009-11-23 Thread Chris McDonough
Martin Aspeli wrote: Meh, I just remembered that I tried this. The current implementation requires that the name value be a literal string object (or at least something convertable to Unicode). I think we could relax this requirement; it really only needs to be hashable. I wouldn't

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

2009-11-23 Thread Chris McDonough
Chris McDonough wrote: Thanks. Yup. I would be +1 on this if the registry itself implemented IDictInterface. If that was untenable, if all the above code lived in the zope.component package itself, and you had an API that manifested an IDictInterface object when you asked for a

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

2009-11-23 Thread Martin Aspeli
Chris McDonough wrote: OK after rereading this, I think we may be massively overthinking this. The above is getting kinda silly. I can't think of a use case where being able to alternate between: reg.utils['root_factory'] and reg.getUtility(IAnonymousUtility,

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

2009-11-23 Thread Chris McDonough
Martin Aspeli wrote: Could maybe we instead just do: class Components(object): def __init__(self, name='', bases=()): self.utils = {} This would be faster, simpler to document, and would require exactly one line of code. Except at this point we've lost all the