On Sun, Mar 20, 2011 at 9:49 AM, Martin Aspeli <optilude+li...@gmail.com> wrote:
> On 20 March 2011 13:46, Jim Fulton <j...@zope.com> wrote:
>> I think we ought to come up with a much cleaner way of defining
>> default configuration. (Pyramid does this by passing default values in
>> adapter calls, but I think we can do a lot better than that.) I'd
>> like to see us come up with a "pythonic" way to wire components up
>> that can be overridden through registration (through zcml or
>> otherwise). Ideally, the mechanism shouldn't "feel" like
>> "configuration" but like "programming".
> You mean like
Hm, it's been a while since I've looked at grok. Some notes:
- The mechanism I'm thinking of should not require *any* ZCML.
- The mechanism shouldn't require something to "grok"/analyze the
code. The mechanism should be explicit. This is implied by
"pythonic". I remember Grok being more implicit than skimming the
links above suggest. Perhaps Grok has has become more explicit than
- I'd prefer not to rely on subclassing, but I'm not dead set against it.
- Whataever we come up with has to work with Python 3, so
unfortunately, we can't use the syntactic trick of having a call in a
The effort should certainly include an analysis of approaches like
grok. Maybe the mechanism should have the effect of enabling tools
like grok to be implemented more cleanly.
Note that the move from "advice-based" syntax to class decorators
provides a good opportunity to revisit how some of this works based
on experience using the ztk.
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -