Re: decorators as generalized pre-binding hooks

2005-07-11 Thread Kay Schluehr
Christopher Subich schrieb: > Kay Schluehr wrote: > > I think it would be a good idea to pronounce the similarity between > > function decorators and metaclasses. Metaclasses were once introduced > > as an arcane art of fuzzy bearded hackers or supersmart 'enterprise > > architects' that plan at

Re: decorators as generalized pre-binding hooks

2005-07-11 Thread Christopher Subich
Kay Schluehr wrote: > I think it would be a good idea to pronounce the similarity between > function decorators and metaclasses. Metaclasses were once introduced > as an arcane art of fuzzy bearded hackers or supersmart 'enterprise > architects' that plan at least products of Zope size but not as a

Re: decorators as generalized pre-binding hooks

2005-07-11 Thread Kay Schluehr
George Sakkis schrieb: > > 1. classes have metaclasses, functions don't have metafunctions. No one > > gave an example for classes not handled at least as well with a metaclass. > > Would something like the following count ? > > @abstractclass > class AbstractFrame(object): > > @abstractclass

Re: decorators as generalized pre-binding hooks

2005-07-10 Thread Ron Adam
Bengt Richter wrote: > On Sun, 10 Jul 2005 05:35:01 GMT, Ron Adam <[EMAIL PROTECTED]> wrote: >>So far they are fairly equivalent. So there's not really any advantage >>over the equivalent inline function. But I think I see what you are >>going towards. Decorators currently must be used when a

Re: decorators as generalized pre-binding hooks

2005-07-10 Thread Terry Reedy
"George Sakkis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Terry Reedy" <[EMAIL PROTECTED]> wrote: >> This possibility was discussed on the py-dev list about a year or so >> ago. >> The twice monthly summaries should include this topic. As I remember, >> the >> reason for l

Re: decorators as generalized pre-binding hooks

2005-07-10 Thread George Sakkis
"Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Bengt Richter" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > The binding of a class name is similar, and class decorators > > would seem natural, i.e., > > > >@cdeco > >class Foo: pass > > for > >class Foo: pass > >Foo

Re: decorators as generalized pre-binding hooks

2005-07-10 Thread Bengt Richter
On Sun, 10 Jul 2005 05:35:01 GMT, Ron Adam <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> ;-) >> We have > >Have we? > >Looks like not a lot of interested takers so far. > >But I'll bite. ;-) > > > > >> So why not >> >> @deco >> foo = lambda:pass >> equivalent to >> foo = deco(la

Re: decorators as generalized pre-binding hooks

2005-07-10 Thread Terry Reedy
"Bengt Richter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The binding of a class name is similar, and class decorators > would seem natural, i.e., > >@cdeco >class Foo: pass > for >class Foo: pass >Foo = cdeco(Foo) This possibility was discussed on the py-dev

Re: decorators as generalized pre-binding hooks

2005-07-09 Thread Ron Adam
Bengt Richter wrote: > ;-) > We have Have we? Looks like not a lot of interested takers so far. But I'll bite. ;-) > So why not > > @deco > foo = lambda:pass > equivalent to > foo = deco(lambda:pass) > > and from there, > @deco > = > being equivalent to > = deco(