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

P

Paul McGuire

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
 
N

Nick Jacobson

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
 
F

Francesco Bochicchio

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
 
P

Paolo Veronelli

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
 
J

John Roth

Paul McGuire said:
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
 
P

Peter Hansen

John said:
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
 
D

Doug Holton

Paul said:
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.
 
P

Paul McGuire

Paolo Veronelli said:
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
 
M

Michael Sparks

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.
 
P

Paul McGuire

Doug Holton said:
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
 
A

Arthur

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
 
P

Paul McGuire

Arthur said:
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
 
V

Ville Vainio

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).
 
A

Arthur

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
 
P

Paul McGuire

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
 
V

Ville Vainio

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>>)
 
M

Mark 'Kamikaze' Hughes

Paul McGuire said:
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

Arien Malec

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,297
Latest member
EngineerD

Latest Threads

Top