Decorator Base Class: Needs improvement.

Ron_Adam radam2 at tampabay.rr.com
Tue Apr 5 22:31:05 EDT 2005


On Tue, 05 Apr 2005 19:38:38 -0400, Steve Holden <steve at holdenweb.com>
wrote:


>> 
>So what you are saying is that you would like to be able to use 
>arbitrarily complex expressions after the :at" sign, as long as they 
>return a decorator? If so, you've been "pronounced" :-)
>
>regards
>  Steve

No not at all,  I never said that.  But.. ;-)


If we get into what I would like, as in my personal wish list, that's
a whole other topic. <g>


I would have preferred the @ symbol to be used as an inline assert
introducer.  Which would have allowed us to put debug code anywhere we
need.  Such as   @print total @.  Then I can switch on and off
debugging statements by setting __debug__ to True or False where ever
I need it.

And as far as decorators go.  I would of preferred a keyword, possibly
wrap, with a colon after it.  Something like this.

def function_name(x):
   return x 

wrap function_name:
   wrapper1()
   wrapper2()
   wrapper3()

A wrap command could more directly accomplish the wrapping, so that
def statements within def statements aren't needed. (Unless you
want'ed too for some reason.)

And as far as arbitrary complex expressions go.. Actually I think that
it's quite possible to do as it is. ;-)

But this is just a few of my current thoughts which may very well
change.  It's an ever changing list. <g>

Cheers,
Ron




More information about the Python-list mailing list