PEP 318: Can't we all just get along?

Michael J. Fromberger Michael.J.Fromberger at Clothing.Dartmouth.EDU
Tue Aug 17 20:56:02 EDT 2004


In article <20040817181725194-0400 at braeburn.themorgue.org>,
 Kevin Smith <Kevin.Smith at sas.com> wrote:
> 
> Bear with me, but I'd like to propose one more syntax that is simple, 
> easy for newbies to understand,  and nowhere near as powerful as the 
> current PEP's syntax.  However, it doesn't add incoherent, arbitrary 
> syntax either.
> 
> def classmethod foo(x, y, z):
>     pass
> 
> That's it.  One "decorator" that is a callable object that takes a 
> method as it's only argument.  No expressions, lists, tuples, etc.  Just 
> one callable object.  Ok, if you absolutely must have more than one.
> 
> def classmethod synchronized foo(x, y, z):
>     pass
> 
> Once again, no expressions.  I know that this isn't going to solve 
> everyone's type-checking, metadata, and function attribute problems, but 
> let's face it, using this PEP for all of those things just creates ugly 
> syntax.  There must be more Pythonic ways to do those things in their 
> own PEPs.

Kevin,

+1 for this idea.

I completely agree that the original PEP-318 proposed a simple and 
reasonable idea, and I too have been much dismayed by all that seems to 
have been grafted onto it since.  This latest idea of yours certainly 
sounds a lot more reasonable than anything else I've seen so far.  It 
solves the original well-defined problem cleanly, and probably solves 
some of the other proposed uses too.  

I would even go so far as to say:  Go ahead and restrict it to at most 
one callable object.  If someone really wants to define a flaming hot 
crossed synchronized blue classmethod foo, they can bloody well define a 
callable object that has the (in)appropriate behaviour.

I hope that perhaps cooler heads (such as yours) will prevail, and keep 
Python's syntax and semantics relatively neat and tidy.  We don't need 
the One PEP to Rule Them All, in the Land of Python where the shadows -- 
so far -- do not lie.

-M, "one more PEP out of you, mister, and you're history!" ;) 

-- 
Michael J. Fromberger             | Lecturer, Dept. of Computer Science
http://www.dartmouth.edu/~sting/  | Dartmouth College, Hanover, NH, USA



More information about the Python-list mailing list