AntiDecorator metaclass

Paul Morrow pm_mon at yahoo.com
Mon Aug 16 06:38:10 EDT 2004


Anthony Baxter wrote:
> On Sat, 14 Aug 2004 08:15:43 -0400, Paul Morrow <pm_mon at yahoo.com> wrote:
> 
>>No I don't want to say that.  I want to say that decorators should keep
>>their nose out of the classmethod/staticmethod business. 
> 
> 
> So what's the point of this, then? You say it's an "anti-decorator" metaclass.
> It's not. It's simply a way to automagically invoke a couple of standard 
> decorators from a metaclass, based on people following a convention.
> 
> It does little or nothing to address many of the other requirements for
> decorators, is brittle (see my previous post on the subject) and relies on
> something that is merely a convention, and deliberately so.
> 

The class was named a little prematurely, but the point was to show that 
  decorator syntax wasn't needed for static or class method declarations 
as simply following a convention does the job just fine.  Just as it 
does for private and semi-private methods.  Are we planning on keeping 
that convention?  Or will we be phasing that out in favor of a method 
visibility decorator?

> 
>>And it makes the problem space that
>>decorators address smaller (as it becomes everything you want decorators
>>to do minus the classmethod/staticmethod stuff), which might give rise
>>to a better, less objectionable solution.
> 
> 
> I fail to see how your hack, which merely removes two of the most trivial
> examples of decorator use, addresses anything in the general case. 
> 

It doesn't, yet.  Again, this is only targeting method types at the moment.

> As far as a "better, less objectionable solution" - as I've said time and time
> again, this subject has had 2+ years of discussion. Do you honestly 
> expect that 2 or 3 more weeks here or there is going to produce some
> blinding flash of insight? I'd love it to be true, but really, I can't see it.

We're about to do something to the language that will make it less 
readable and more intimidating.  That's bad. So maybe if we limit the 
scope of what decorators need to do, they won't be used that often.  And 
  that would be good.




More information about the Python-list mailing list