By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,888 Members | 1,588 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,888 IT Pros & Developers. It's quick & easy.

Alternative decorator syntax - POLL RESULTS SO FAR - ARE WE DONE?

P: n/a
Well, after 3 days of open polling, the number of additional votes have
dropped off pretty dramatically. Here are the results so far:

Total voters: 55 (with 3 votes each)
Votes for each choice or group of choices:
Any J 81
J2 78
Any C 40
C1 29
Any D 9
C2 8
D2 6
F 6
L 5
Any E 5
A1 4
H 4
K 4
Any A 4
B 3
D1 3
E1 3
C3 2
I 2
J1 2
C4 1
E2 1
E4 1
J3 1
M 1
A2 0
E3 0
G 0
J4 0

This would put J2 and C1 as the clear favorites among those who voted, with
J2 between 2:1 and 3:1 more strongly favored. Of all of the votes cast, J2
received 48%, C1 received 18%. No other option received more than 10% of
any votes.

However, the multivote format gives us some additional information, over
conventional "one-person-one-vote" format. Of the 55 voters, 75% cast at
least one vote for J2, while only 35% cast one or more votes for C1. From
the standpoint of building concensus, I find this statistic more compelling
than the raw vote count. It tells me that 3/4 of the voting sample are at
least open to the option presented by J2, so that developing community
acceptance is more likely to happen more quickly with J2 than with C1.

I believe that Anthony Baxter's read of Guido's intentions on what happens
next are fairly accurate (Anthony has been very active on python-dev and in
private e-mails on this subject, and I'm sure his view is more than most of
us here on c.l.py) - I think Guido has challenged us to rally around *one*
alternative to the current @ syntax, and from this poll, I think J2 is our
collective best bet. I do *not* think that Guido plans to have a run-off
between the chosen alternative and the @ syntax, nor that he would give much
credence to one if it were held - remember what the D in BDFL stands for.
But I think he *will* be pleased that among the babel of syntax proposals
that have been put forward, this fairly unstructured and unorganized group
will have come to closure and met his challenge, and settled on *one*
alternative option. I believe that Robert Brewer's technical discussion and
Michael Sparks' implementation will at least cause him to seriously consider
our concensus choice as a viable alternative to the @ syntax.

I'm sure that there are many asking if 55 is a sufficient sample for
determining the wishes of the Python community. I have no response other
than to say that this poll was posted on an open Usenet forum, and that it
quickly gathered a breadth of responses (despite the fact that many people
are just tired of talking and reading about decorators), and that the
response rate noe looks to be dropping off. I am skeptical that additional
time will significantly change the results. And I'm not sure what other
measures to take to obtain further responses. If there are other forums for
eliciting these inputs, I would have hoped that those who follow c.l.py
would have already contacted them for their participation.

So I would like to propose that we collectively move forward with J2 as our
selected alternative. I would say that those who proposed other
alternatives are not "the losers" in this, that they put valued thought and
discussion into this overall topic. In fact, the J2 proposal evolved over
the past several months, and I believe this is in part due to the influence
of concepts put forth in other proposals. I believe that both C1 and J2 are
clear, Pythonic, and pleasing to the eye, but in the interests of moving
forward, we need to focus our efforts in a single direction from here on.
If we continue to promote our other various favorites, I think it's fairly
certain that we will all be typing @ characters after release 2.4 comes out.

Please start giving some thought to what the 'decorate' keyword should be.
If we can get/keep this selection to a manageable list, then we should have
another multivote some time next week.

-- Paul


Jul 18 '05 #1
Share this Question
Share on Google+
28 Replies


P: n/a
"Paul McGuire" <pt***@austin.rr._bogus_.com> writes:
Please start giving some thought to what the 'decorate' keyword should be.


Looks like "declare" to me ;-)
Jul 18 '05 #2

P: n/a
>
Please start giving some thought to what the 'decorate' keyword should be.
If we can get/keep this selection to a manageable list, then we should have
another multivote some time next week.

-- Paul

How about 'predef'?

--Nick
Jul 18 '05 #3

P: n/a
On Sun, 22 Aug 2004 02:53:09 +0000, Paul McGuire wrote:
Please start giving some thought to what the 'decorate' keyword should be.
If we can get/keep this selection to a manageable list, then we should have
another multivote some time next week.


If you are still open to lurkers suggestions, I'm partial to syntax that
can be read like common language (this is one reason why I like Python and
I mildly dislike the @ sintax). Therefore I would like to suggest
to use in J2 keywords like 'using' or 'with', which also hint to the fact
that this is only the first part of a declaration suite that will be
continued by the 'def' statement.

Ciao
-------
FB

Jul 18 '05 #4

P: n/a


Some morphological images suggest me "through" can be a keyword as it
hide the verb filter which can be a little more general then others.
Anyway using a verb or a noun doesn't suggest the orthogonality of the
piece,so please consider adverbs as clever candidates.

Paolino
Jul 18 '05 #5

P: n/a

"Paul McGuire" <pt***@austin.rr._bogus_.com> wrote in message
news:pU*****************@fe1.texas.rr.com...
Well, after 3 days of open polling, the number of additional votes have
dropped off pretty dramatically. Here are the results so far:

Total voters: 55 (with 3 votes each)
Now that I've had a chance to look at the syntax, you can count
me mildly in favor of J2. (I haven't voted yet.) It's an extra line,
but I think the explicitness outweighs the vertical space it
takes up.

The keyword is fine even though it will almost certainly require
a future statement for 2.4.

John Roth


Jul 18 '05 #6

P: n/a
John Roth wrote:
Now that I've had a chance to look at the syntax, you can count
me mildly in favor of J2. (I haven't voted yet.) It's an extra line,
but I think the explicitness outweighs the vertical space it
takes up.


Although I'm not sure it was implemented this way, I
believe there may be an intent to support the usual
sort of one-line version as this (using an alternate
keyword instead of "decorate" which now seems doomed):

using: staticmethod
def foo(bar, baz):
pass

That makes it no extra lines, but still explicit and Pythonic
in nature.

(Michael, was that how you implemented the latest?)

-Peter
Jul 18 '05 #7

P: n/a
Paul McGuire wrote:
Total voters: 55
Of all of the votes cast, J2
received 48%, C1 received 18%. No other option received more than 10% of
any votes.


I vote 3 times for C1. So just my one vote raises C1 to 20%. I think
you need to do an online poll so you get more people than just those who
have been discussing the decorator keyword here this past week. I got
over 250 votes for C1 just last week vs. the 22 who voted for J2 here.
During this 2nd poll people were confused about whether they could vote
for A1 or not, and some people said many of the options on the wiki page
were not allowed anymore.

Just make a poll with J2 vs. C1 and see what you find.
Jul 18 '05 #8

P: n/a
"Paolo Veronelli" <pa*************@yahoo.it> wrote in message
news:ma**************************************@pyth on.org...


Some morphological images suggest me "through" can be a keyword as it
hide the verb filter which can be a little more general then others.
Anyway using a verb or a noun doesn't suggest the orthogonality of the
piece,so please consider adverbs as clever candidates.

Paolino


I always thought "through" was a preposition. So I googled for lists of
prepositions, and found these other candidates (they are also shorter):

per
via

-- Paul
Jul 18 '05 #9

P: n/a
On Sun, 22 Aug 2004 08:07:53 -0500, Doug Holton <in****@spam.here>
wrote:
Paul McGuire wrote:
Total voters: 55
Of all of the votes cast, J2
received 48%, C1 received 18%. No other option received more than 10% of
any votes.


I vote 3 times for C1. So just my one vote raises C1 to 20%. I think
you need to do an online poll so you get more people than just those who
have been discussing the decorator keyword here this past week. I got
over 250 votes for C1 just last week vs. the 22 who voted for J2 here.
During this 2nd poll people were confused about whether they could vote
for A1 or not, and some people said many of the options on the wiki page
were not allowed anymore.


I think it should also be noted in the report of the voting results
that the a vote for "no new syntax at this time" was specifically
outlawed.

As a side point:

It seems ironic to me that in a group devoted to an appreciation of
Python, and its advocacy - it is often those who reject the notion
that the language has the kinds of glaring weaknesses that require
some fundamental change ot it, that form the opposition to an
"establishment" that has become convinced quite otherwise.

I sometimes wish those folks were more candid about its deficiencies
before I started my study of it back in 1.5.2 days.

Art
Jul 18 '05 #10

P: n/a
Peter Hansen wrote:
....
Although I'm not sure it was implemented this way, I
believe there may be an intent to support the usual
sort of one-line version as this (using an alternate
keyword instead of "decorate" which now seems doomed):

using: staticmethod
def foo(bar, baz):
pass

That makes it no extra lines, but still explicit and Pythonic
in nature.

(Michael, was that how you implemented the latest?)


I'm certainly intending to have this short form. However first of all I'm
working through producing a full patch based on Anthony Baxter's pointer,
to the original patch.

When I do add the short form, it's most likely to include the replacement
"using" keyword. The impact of "decorate" and "declare" on user code looks
too large for comfort. (Well known projects broken by one or the other
include mailman and Pyrex)

Interestingly though the form as implemented does already allow for:

decorate:
staticmethod synchronised deprecated
def foo(baz):
pass

Largely because the current 2.4a2 form allows for:

@staticmethod @synchronised @deprecated
def foo(baz):
pass

Both of which strike me generally speaking as nicer than the long list
approach. Once I've made the change I intend to make (assuming it's simple
enough) I'll make the simple/short form allow (assuming possible):

using: staticmethod synchronized deprecated memoize
def foo(baz):
pass

Mark Russell did a real a really nice job on the original implementation,
and when this is all over that's where the real thanks are due!

Regards,
Michael.

Jul 18 '05 #11

P: n/a

"Arthur" <aj******@optonline.com> wrote in message
news:if********************************@4ax.com...
On Sun, 22 Aug 2004 08:07:53 -0500, Doug Holton <in****@spam.here>
wrote:
Paul McGuire wrote:
Total voters: 55
Of all of the votes cast, J2
received 48%, C1 received 18%. No other option received more than 10% of any votes.


I vote 3 times for C1. So just my one vote raises C1 to 20%. I think
you need to do an online poll so you get more people than just those who
have been discussing the decorator keyword here this past week. I got
over 250 votes for C1 just last week vs. the 22 who voted for J2 here.
During this 2nd poll people were confused about whether they could vote
for A1 or not, and some people said many of the options on the wiki page
were not allowed anymore.


I think it should also be noted in the report of the voting results
that the a vote for "no new syntax at this time" was specifically
outlawed.

As a side point:

It seems ironic to me that in a group devoted to an appreciation of
Python, and its advocacy - it is often those who reject the notion
that the language has the kinds of glaring weaknesses that require
some fundamental change ot it, that form the opposition to an
"establishment" that has become convinced quite otherwise.

I sometimes wish those folks were more candid about its deficiencies
before I started my study of it back in 1.5.2 days.

Art

Jul 18 '05 #12

P: n/a


Paul McGuire wrote:
"Paolo Veronelli" <pa*************@yahoo.it> wrote in message
news:ma**************************************@pyth on.org...

Some morphological images suggest me "through" can be a keyword as it
hide the verb filter which can be a little more general then others.
Anyway using a verb or a noun doesn't suggest the orthogonality of the
piece,so please consider adverbs as clever candidates.

Paolino

I always thought "through" was a preposition.


Poor ignorant I am ;-[
So I googled for lists of
prepositions, and found these other candidates (they are also shorter):

per
via also "by" is a substitute for as

-- Paul

Jul 18 '05 #13

P: n/a
"Doug Holton" <in****@spam.here> wrote in message
news:t5********************@comcast.com...
Paul McGuire wrote:
Total voters: 55
Of all of the votes cast, J2
received 48%, C1 received 18%. No other option received more than 10% of any votes.


I vote 3 times for C1. So just my one vote raises C1 to 20%. I think
you need to do an online poll so you get more people than just those who
have been discussing the decorator keyword here this past week. I got
over 250 votes for C1 just last week vs. the 22 who voted for J2 here.
During this 2nd poll people were confused about whether they could vote
for A1 or not, and some people said many of the options on the wiki page
were not allowed anymore.

Just make a poll with J2 vs. C1 and see what you find.

Doug -

Robert Brewer advised against ending this c.l.py poll prematurely (which I
thought *was* a form of "online poll"), and your posting reaffirms that
suggestion.

I've put you down for 3 votes for C1. But by my spreadsheet, adding 3 votes
to C1 shifts the percentages to 46.7% for J2 and 19.2% for C1. And if you
look at the consensus statistic, this doesn't significantly change the
number of people expressing some support for either (73.2% of voters cast at
least one vote for J2, 35.7% cast at least one for C1).

Fewer than 3% of the votes were cast for A1, so I don't think this had a
major effect on the overall distribution of the results.

One of the main purposes of multivoting is to do just what you propose - to
narrow a field of many choices down to just 2. It looks like this poll is
very close to achieving that, and I really don't think this will change
significantly over the next few days.

One of the issues with a "one-person-one-vote" poll is that you don't get a
sense of a voter's willingness to be open to multiple alternatives. When
you are all done, all you have is "X% for A and Y% for B" - short of
unanimity, I don't think this is much of a basis for consensus among an
anonymous group. Even an 80/20 or 90/10 split just tells you that 10-20% of
the voters will be overridden by the majority. (I get the feeling that
there are some out there who are distrustful of this whole process, and
short of a 100% return for one choice, will not concede that we have arrived
at consensus. ) What I like about multivoting is that it allows people to
express preferences, but also openness to alternatives. And consequently, I
think the process is less divisive. But just to show how compelling these
results are so far, imagine that *every* vote had been J2, J2, C1 or C1, C1,
J2 The absolute results would have been a 66%/33% split, and the consensus
vote would have been 50%/50%. What we got so far is 47/19 (which is even
more lopsided than 66/33) and 73/35.

Mark Twain said there are 3 types of lies: lies, damned lies, and
statistics. I'm not trying to confuse the issue, I *am* trying to convey
that I think there is more consensus here than a simple percentage would
imply.

-- Paul
Jul 18 '05 #14

P: n/a
On Sun, 22 Aug 2004 08:07:53 -0500, Doug Holton <in****@spam.here>
wrote:
Paul McGuire wrote:
Total voters: 55
Of all of the votes cast, J2
received 48%, C1 received 18%. No other option received more than 10% of
any votes.


I vote 3 times for C1. So just my one vote raises C1 to 20%. I think
you need to do an online poll so you get more people than just those who
have been discussing the decorator keyword here this past week. I got
over 250 votes for C1 just last week vs. the 22 who voted for J2 here.
During this 2nd poll people were confused about whether they could vote
for A1 or not, and some people said many of the options on the wiki page
were not allowed anymore.


I think it should also be noted in the report of the voting results
that the a vote for "no new syntax at this time" was specifically
outlawed.

As a side point:

It seems ironic to me that in a group devoted to an appreciation of
Python, and its advocacy - it is often those who reject the notion
that the language has the kinds of glaring weaknesses that require
some fundamental change ot it, that form the opposition to an
"establishment" that has become convinced quite otherwise.

I sometimes wish those folks were more candid about its deficiencies
before I started my study of it back in 1.5.2 days.

Art
Jul 18 '05 #15

P: n/a

"Arthur" <aj******@optonline.com> wrote in message
news:if********************************@4ax.com...
On Sun, 22 Aug 2004 08:07:53 -0500, Doug Holton <in****@spam.here>
wrote:
Paul McGuire wrote:
Total voters: 55
Of all of the votes cast, J2
received 48%, C1 received 18%. No other option received more than 10% of any votes.


I vote 3 times for C1. So just my one vote raises C1 to 20%. I think
you need to do an online poll so you get more people than just those who
have been discussing the decorator keyword here this past week. I got
over 250 votes for C1 just last week vs. the 22 who voted for J2 here.
During this 2nd poll people were confused about whether they could vote
for A1 or not, and some people said many of the options on the wiki page
were not allowed anymore.


I think it should also be noted in the report of the voting results
that the a vote for "no new syntax at this time" was specifically
outlawed.

As a side point:

It seems ironic to me that in a group devoted to an appreciation of
Python, and its advocacy - it is often those who reject the notion
that the language has the kinds of glaring weaknesses that require
some fundamental change ot it, that form the opposition to an
"establishment" that has become convinced quite otherwise.

I sometimes wish those folks were more candid about its deficiencies
before I started my study of it back in 1.5.2 days.

Art

Jul 18 '05 #16

P: n/a
>>>>> "Arthur" == Arthur <aj******@optonline.com> writes:

Arthur> It seems ironic to me that in a group devoted to an
Arthur> appreciation of Python, and its advocacy - it is often
Arthur> those who reject the notion that the language has the
Arthur> kinds of glaring weaknesses that require some fundamental
Arthur> change ot it, that form the opposition to an
Arthur> "establishment" that has become convinced quite otherwise.

If you don't want improvements to the language, don't download the new
version. Keep on writing the code in the old style, and run foreign
code through a preprocessor that e.g. converts decorators to the old
non-syntax style.

If you really want a stagnant, non-evolving language, there are many
to choose from. I guess Python could also be forked to a special
ZombiePython edition, where heresy like a+=4 and list comprehensions
are unheard of.

Arthur> I sometimes wish those folks were more candid about its
Arthur> deficiencies before I started my study of it back in 1.5.2
Arthur> days.

If Python was still like 1.5.2, 90% of the current community would be
running Ruby (assuming it would have evolved while Python had
stagnated).

--
Ville Vainio http://tinyurl.com/2prnb
Jul 18 '05 #17

P: n/a
>>>>> "Arthur" == Arthur <aj******@optonline.com> writes:

Arthur> It seems ironic to me that in a group devoted to an
Arthur> appreciation of Python, and its advocacy - it is often
Arthur> those who reject the notion that the language has the
Arthur> kinds of glaring weaknesses that require some fundamental
Arthur> change ot it, that form the opposition to an
Arthur> "establishment" that has become convinced quite otherwise.

If you don't want improvements to the language, don't download the new
version. Keep on writing the code in the old style, and run foreign
code through a preprocessor that e.g. converts decorators to the old
non-syntax style.

If you really want a stagnant, non-evolving language, there are many
to choose from. I guess Python could also be forked to a special
ZombiePython edition, where heresy like a+=4 and list comprehensions
are unheard of.

Arthur> I sometimes wish those folks were more candid about its
Arthur> deficiencies before I started my study of it back in 1.5.2
Arthur> days.

If Python was still like 1.5.2, 90% of the current community would be
running Ruby (assuming it would have evolved while Python had
stagnated).

--
Ville Vainio http://tinyurl.com/2prnb
Jul 18 '05 #18

P: n/a
On 22 Aug 2004 19:27:59 +0300, Ville Vainio <vi***@spammers.com>
wrote:
>> "Arthur" == Arthur <aj******@optonline.com> writes:

Arthur> It seems ironic to me that in a group devoted to an
Arthur> appreciation of Python, and its advocacy - it is often
Arthur> those who reject the notion that the language has the
Arthur> kinds of glaring weaknesses that require some fundamental
Arthur> change ot it, that form the opposition to an
Arthur> "establishment" that has become convinced quite otherwise.

If you don't want improvements to the language, don't download the new
version. Keep on writing the code in the old style, and run foreign
code through a preprocessor that e.g. converts decorators to the old
non-syntax style.

If you really want a stagnant, non-evolving language, there are many
to choose from. I guess Python could also be forked to a special
ZombiePython edition, where heresy like a+=4 and list comprehensions
are unheard of.
This reaction to my remarks is predictable.

Ascribing to those remarks an extremism they do not intend. And then
attacking that extreme position.

Why did new style classes and attendant matters - the most sweeping
re-architecture of the language probably since its inception - make it
into the language without a near peep of controversy? And integer
division cause an uproar?

To me, the first seems evolutionary and truly seems to be Guido's
inner gyroscope at work The second made its way to the top of the
agenda in round-about ways, and seemed a near arbitrary point of
focus.

Since I've been around, the controversial issues are the ones that
deserved their controversy - Python folks being a reasonable and
intelligent lot.

Art

Arthur> I sometimes wish those folks were more candid about its
Arthur> deficiencies before I started my study of it back in 1.5.2
Arthur> days.

If Python was still like 1.5.2, 90% of the current community would be
running Ruby (assuming it would have evolved while Python had
stagnated).


Jul 18 '05 #19

P: n/a
"Arthur" <aj******@optonline.com> wrote in message
news:if********************************@4ax.com...
On Sun, 22 Aug 2004 08:07:53 -0500, Doug Holton <in****@spam.here>
wrote: <snip>
I think it should also be noted in the report of the voting results
that the a vote for "no new syntax at this time" was specifically
outlawed.

Arthur -

You should really direct this sentiment to Guido himself. I think he's made
his mind pretty clear on python-dev that some form of decorator syntax is
coming, and that it's coming in 2.4. All this voting process is doing is
trying to respond to his call for a unified alternative proposal. I think
just about everyone who has had any part in this debate feels that just
about all of the relevant issues have been surfaced, and now it is time to
move forward with making some decisions. Personally, I think this is why
Guido forced the issue by asking Anthony Baxter to go ahead and check in the
"@"-based syntax. But that is his process and his choice - please forward
your comments on this to him.

As far as your comments re: the multivoting process, I'm sorry you felt
disenfranchised. You should note that others took the initiative to add
their choices to the wiki page when they were not in the initial selection
set, and I think a vote of "No decorators, No decorators, No decorators"
would have made your point, at least amongst us at c.l.py. But even if we
all rally behind "No decorators", I think the result will be that "@" syntax
will then prevail by default.

In any case, the polls are still "open" - should I put you down for "None of
the above" X 3 ?

-- Paul
Jul 18 '05 #20

P: n/a
>>>>> "Arthur" == Arthur <aj******@optonline.com> writes:
If you really want a stagnant, non-evolving language, there are
many to choose from. I guess Python could also be forked to a
special ZombiePython edition, where heresy like a+=4 and list
comprehensions are unheard of.


Arthur> This reaction to my remarks is predictable.

Arthur> Ascribing to those remarks an extremism they do not
Arthur> intend. And then attacking that extreme position.

That's possibly true. I hope you accept my apology for extrapolating
your attitude more than is fair.

Arthur> Since I've been around, the controversial issues are the
Arthur> ones that deserved their controversy - Python folks being
Arthur> a reasonable and intelligent lot.

Perhaps - but I don't remember any controversial decision where an
obviously wrong path was chosen. Most monstrosities were incoporated
before I started to read c.l.py, though (`repr`, print>>)

--
Ville Vainio http://tinyurl.com/2prnb
Jul 18 '05 #21

P: n/a
Paul McGuire <pt***@austin.rr._bogus_.com>
wrote on Sun, 22 Aug 2004 02:53:09 GMT:
Well, after 3 days of open polling, the number of additional votes have
dropped off pretty dramatically. Here are the results so far:


My server didn't receive the poll at all, AFAICT. So my votes are:
A1 L L

I'd rather have a keyword than punctuation, but the placement is
exactly right, and I have zero problem with @.

If I could vote *against* something, it would be C1. That's the most
amazingly horrible code, and leads to indentation wars for all eternity.

--
<a href="http://kuoi.asui.uidaho.edu/~kamikaze/"> Mark Hughes </a>
"Virtues foster one another; so too, vices.
Bad English kills trees, consumes energy, and befouls the Earth.
Good English renews it." -The Underground Grammarian, v1n2
Jul 18 '05 #22

P: n/a
"Paul McGuire" <pt***@austin.rr._bogus_.com> wrote in
news:pU*****************@fe1.texas.rr.com:
Please start giving some thought to what the 'decorate' keyword should
be. If we can get/keep this selection to a manageable list, then we
should have another multivote some time next week.


"transform:"

In general:

Something that is either semantic neutral, or makes semantics explicit.

Arien
Jul 18 '05 #23

P: n/a
In article <pU*****************@fe1.texas.rr.com>,
"Paul McGuire" <pt***@austin.rr._bogus_.com> wrote:

[snip]

As an occasional lurker, I haven't had a chance to participate in the
discussion about decorator syntax but for what its worth, I prefer the
J2 syntax over the @pie syntax. It just seems more natural to me. When I
first looked at the @pie syntax, I hoped that Guido would not include it
as it reminded me too much of Perl black magic.

Anyway, my vote is for the J2 option and "using" as the keyword seems to
be the best fit for this option.

Regards,
Mahesh
Jul 18 '05 #24

P: n/a
Hi,

Le 22-08-2004, Paul McGuire <pt***@austin.rr._bogus_.com> a écrit*:
Well, after 3 days of open polling, the number of additional votes have
dropped off pretty dramatically. Here are the results so far:

Total voters: 55 (with 3 votes each)


Here is my vote, in case it can still be included.

C2 C2 J2

Concerning the choice of the keyword, I'd vote *against* decorate and for
something like predef (J2), with (C2, J2), using (C2).

Concerning the @-thingy, it's the worst proposal I have ever heard concerning
Python. Sounds too cryptic to be true... must be a joke.

I'd like to add that the EuroPython poll was clearly in favor of *not* using
the @thing in front of functions and that this poll results also said that
people would rather not include the "decorator" feature in the next
release than include it as described.

Last but not least, the best option would IMHO not to implement so-called
decorators without thinking seriously about what they are supposed to do
exactly, as title 7 says at http://www.python.org/moin/PythonDecorators

In other words "it's getting urgent to wait".

--
Nicolas Chauvat

logilab.fr - services en informatique avancée et gestion de connaissances
Jul 18 '05 #25

P: n/a
Arien Malec <ar*********@yahoo.com.REMOVE> wrote in message news:<Xn********************************@64.164.98 .29>...
"Paul McGuire" <pt***@austin.rr._bogus_.com> wrote in
news:pU*****************@fe1.texas.rr.com:
Please start giving some thought to what the 'decorate' keyword should
be. If we can get/keep this selection to a manageable list, then we
should have another multivote some time next week.


"transform:"

In general:

Something that is either semantic neutral, or makes semantics explicit.


A verb of neutral meaning, like "transform", seems more likely to
cause difficulty with old code. I would expect there to be hundreds
of Python functions in use right now with the name "transform",
because that verb encompasses many things that functions often do. A
function may be called at any level of indentation, and there would be
no way for the parser to distinguish a function call from a
decoration. This same objection can be voiced about any keyword, and
is the reason why this option would definitely entail an "from
__future__ import decorators", but many words would conflict less than
"transform".

Another objection that has been raised about my current favorite,
"decorate", is that at 8 characters it's too long. 9 characters will
also be considered too long by a number of people.

The natural short version of "decorate" would be "dec" and there is
sort of a natural parallelism with "def" there. I hesitate to
nominate it because it _feels_ like a word that at least ten people on
c.l.py will detest.

Maybe "decor"? It isn't any longer than "class", and I think we can
predict it will be typed less than 1/10 as often. But this reasoning
could also excuse "decorate", so I'll stick with that. I'm also open
to any transitive verb that can be designated to mean _exactly_ what
"decorate" means now.

later,
Jess
Jul 18 '05 #26

P: n/a
On 24 Aug 2004 13:53:58 -0700, Jess Austin <je*********@gmail.com> wrote:
The natural short version of "decorate" would be "dec" and there is
sort of a natural parallelism with "def" there. I hesitate to
nominate it because it _feels_ like a word that at least ten people on
c.l.py will detest.
'dec' is also going to clash with a lot of code that uses that. That's going
to be a problem with pretty much any short keyword.
Maybe "decor"? It isn't any longer than "class", and I think we can
predict it will be typed less than 1/10 as often. But this reasoning
could also excuse "decorate", so I'll stick with that. I'm also open
to any transitive verb that can be designated to mean _exactly_ what
"decorate" means now.


decor is better - I can't find any uses of it in the Python code I just grepped
over...
Jul 18 '05 #27

P: n/a
Anthony Baxter <an***********@gmail.com> writes:
'dec' is also going to clash with a lot of code that uses that. That's going
to be a problem with pretty much any short keyword.


I really am liking J2 less and less. Even @pie seems more natural.
The best in my opinion is still J4 with no keyword.
Jul 18 '05 #28

P: n/a
Jess Austin wrote:
Another objection that has been raised about my current favorite,
"decorate", is that at 8 characters it's too long. 9 characters will
also be considered too long by a number of people.

The natural short version of "decorate" would be "dec" and there is
sort of a natural parallelism with "def" there. I hesitate to
nominate it because it _feels_ like a word that at least ten people on
c.l.py will detest.

Maybe "decor"? It isn't any longer than "class", and I think we can
predict it will be typed less than 1/10 as often. But this reasoning
could also excuse "decorate", so I'll stick with that. I'm also open
to any transitive verb that can be designated to mean _exactly_ what
"decorate" means now.


J2 J2 F, but I'm a lurker and Python newbie, so... ;)

I kind of like the keyword "alter", but I suspect that, like many other
such words, it will conflict quite a bit with existing code. One of the
issues that some have raised was the disconnect between the "using" and
"def" lines. What about copying the pattern used by if/elif; something
like (I like the first the best, I think it "reads well," while the
second is the shortest and has a nice rhythm):
alterdef:
classmethod
def foo():
pass
decdef:
classmethod
def foo():
pass
decoratedef:
classmethod
def foo():
pass
Of course, this will mean that there would also be an "alterclass:" if
classes need decorators (in this case, "decclass:" doesn't seem as nice,
and reusing "alterdef:" is downright misleading).

Just a thought,
Eli

Jul 18 '05 #29

This discussion thread is closed

Replies have been disabled for this discussion.