[Python-Dev] PEP 318: Can't we all just get along? (original) (raw)
Gregory Lielens gregory.lielens at fft.be
Thu Aug 19 15:27:03 CEST 2004
- Previous message: [Python-Dev] PEP 318: Can't we all just get along?
- Next message: [Python-Dev] PEP 318: Can't we all just get along?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, 2004-08-19 at 12:58, Gareth McCaughan wrote:
On Thursday 2004-08-19 06:58, Guido van Rossum wrote: > > From the posts I've seen here, the only alternatives that have > > considerable popular support are ones that you've already > > rejected. So I suspect nobody really feels it's worth trying. > > Well, do people generally buy those rejections, or is their consensus > that I'm mistaken?
I'm one of the people who doesn't really feel it's worth trying.
For what it's worth, me too ;-) First, a warning: I have never used any decorator and I jumped in this discussion (poor me ;-) ) purely from an aesthetic/syntax-coherence point of view. It is just because @decorator feels so odd compared to the rest of python that I though I had to react...
Why odd? Because:
@ is a new symbol, and is slightly annoying for ipython that I use (while I have yet to encounter decorators :-) )
@ perform a "magic" operation, applying a callable object to something that will be defined (possibly multiple line) after (and in a certain order that we have to remember)...This is very unlike all other binary and unary symbol operation we have currently in python, and not common in programming languages imho
That being said, I am not anti-punctuation, nor anti-symbol, nor anti-@?|!#%-cause-it-trigger-my-perl-allergy ;-) (I am behind a PEP for elementwise operators, if anybody need proof ;-) ), but in the decorator case I do not see it as a readability improvement
And mostly, what I find odd is the application of decorators to next definition, this feels like an entirely new syntax concept to me, while the list after def seems more like a slight extension, so is the decorate: dec1 dec2 def f(): ... proposal (although I feel like the extension is more drastic in this case)...
So my question/feeling is: are decorator so important that a whole-new syntax (instead of an extension of existing syntax) is needed?
For now, I do not have seen any reason to believe it is, and worse, I do not personally find the list after def or variants (especially my own variant, def f(...) "pseudo-keyword" or "%" iterable-object :, of course ;-) ) any less clear or difficult to parse than the @ version, even with very complex decorators.
I also think at this stage the only reason to change my feeling about this would be to have other cases beside decorator where the pie-syntax @stuff @more_stuff @and_some_extra_stuff applied_to_me would be used, so that this new syntax have more reason to exist...
However, even if my feeling against @ pie is strong, I slowly got ready to bite the bullet (and to pray for seeing this @ as less as possible) giving that there is a huge multiplication of possible syntax, while comments on each possible syntax are seemingly decreasing...This looks like end-of-story too me, hence my "too bad, but let's move" feeling...
One possible thing that may help make an alternative syntax emerge would be for Guido to parse the wiki and definitely reject some of the proposals, so that people can progressively gather behind the ones left...a sort of sorry-you're dismissed kind of game ;-)
Else, I fear that only-one-alternative-syntax-or-it-will-be-@ is a polite way to say it-will-be-@ ;-P
Regards,
Greg.
- Previous message: [Python-Dev] PEP 318: Can't we all just get along?
- Next message: [Python-Dev] PEP 318: Can't we all just get along?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]