Python Decorator民意调查的获胜者是...... [英] The winner of the Python Decorator Poll is...

查看:48
本文介绍了Python Decorator民意调查的获胜者是......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

George W Bush,经佛罗里达选举委员会认证。

您最喜欢哪种装饰器语法?参见
http://wiki.wxpython.org/index.cgi / PythonDecoratorsPoll

A. @classmethod def foo():( 82)14%

C1。 def foo()[classmethod] :( 235)41%

E1。 def foo():@classmethod(260)45%

总票数:577

人们大约6比1反对装饰员来到

" def"关键字。

George W Bush, as certified by Florida''s election commission.
Which decorator syntax do you like the most? See
http://wiki.wxpython.org/index.cgi/PythonDecoratorsPoll
A. @classmethod def foo(): (82) 14%
C1. def foo() [classmethod]: (235) 41%
E1. def foo(): @classmethod (260) 45%

Total Votes: 577

People are about 6 to 1 against having the decorators come before the
"def" keyword.

推荐答案

2004年8月11日星期三04:16:54 -0500,Doug Holton写道:
On Wed, Aug 11, 2004 at 04:16:54PM -0500, Doug Holton wrote:
George W Bush,经佛罗里达选举委员会认证。

您最喜欢哪种装饰器语法?参见
http://wiki.wxpython.org/index.cgi / PythonDecoratorsPoll
A. @classmethod def foo():( 82)14%
C1。 def foo()[classmethod] :( 235)41%
E1。 def foo():@classmethod(260)45%

总票数:577


人们大约6比1反对让装饰者来到
之前; DEF"关键字。
George W Bush, as certified by Florida''s election commission.
Which decorator syntax do you like the most? See
http://wiki.wxpython.org/index.cgi/PythonDecoratorsPoll
A. @classmethod def foo(): (82) 14%
C1. def foo() [classmethod]: (235) 41%
E1. def foo(): @classmethod (260) 45%

Total Votes: 577

People are about 6 to 1 against having the decorators come before the
"def" keyword.




或者在def之前不喜欢装修者的人是6次因为在b = 2 b b b b b b b b b眨眼*


-Jack



Or people who don''t like decorators before the def are six times as
likely to vote in the dissidents poll *wink*

-Jack


Doug Holton写道:
Doug Holton wrote:
您最喜欢哪种装饰器语法?参见
http://wiki.wxpython.org/index.cgi / PythonDecoratorsPoll
A. @classmethod def foo():( 82)14%
C1。 def foo()[classmethod] :( 235)41%
E1。 def foo():@classmethod(260)45%

总票数:577


人们大约6比1反对让装饰者来到
之前; DEF"关键字。
Which decorator syntax do you like the most? See
http://wiki.wxpython.org/index.cgi/PythonDecoratorsPoll
A. @classmethod def foo(): (82) 14%
C1. def foo() [classmethod]: (235) 41%
E1. def foo(): @classmethod (260) 45%

Total Votes: 577

People are about 6 to 1 against having the decorators come before the
"def" keyword.




虽然我在投票中投了票,但实际上投票给了其中一个

两个之后。方法(我忘了哪个,没关系),我想要

来指出从民意调查结果中推断的危险

到未经证实的索赔,例如你的那个制作。


民意调查结果显示,按照比例为6比1,投票的人们更倾向于选择
第一个。没有更多,没有更少。民意调查没有提到它是前后之间的选择,

因此你不应该对什么做出假设

是那些投票的主意。


例如,有装饰:最近演变的选项

来自本论坛的讨论已经出现,我会比上面显示的任何方法都优先选择
。那是'b $ b因为我对前后事物没有宗教信仰

因为我超过了标点符号和Pythonic风格

问题。 装饰:选项是最接近的适用于
Python风格,恕我直言,甚至比def-list更加合适,并且

即使它出现在def之前也没有''由于缩进的块结构与Python中的其他类似构造非常相似,所以我很担心

我。


而我''我确定我并不孤单,但还没有人在

上做过调查。 ;-)


-Peter



While I voted in that poll, and in fact voted for one of the
two "after" methods (I forget which, doesn''t matter), I want
to point out the danger of extrapolating from the poll results
to unsubstantiated claims such as the one you make.

The poll results show that by a ratio of 6 to 1, people
who voted prefer either of the second two options to the
first one. Nothing more, nothing less. The poll didn''t
mention that it was a choice between before and after,
and therefore you shouldn''t make assumptions about what
was in the minds of those voting.

For example, had the "decorate:" option that recently evolved
from discussion in this forum been present, I would have
preferred it over any of the methods show above. That''s
because I''m not religious about the before or after thing
so much as I am over the punctuation and Pythonic-style
issues. The "decorate:" option is the closest fit with
Python style, IMHO, even more so than list-after-def, and
even the fact that it comes before the def doesn''t bother
me since the indented block structure feels very similar
to other such constructs in Python.

And I''m sure I''m not alone, but nobody''s done a poll on
it yet. ;-)

-Peter


Peter Hansen写道:
Peter Hansen wrote:
民意调查结果显示,按照比例为6比1,投票的人更喜欢第二个选项中的任何一个。没有更多,没有更少。
The poll results show that by a ratio of 6 to 1, people
who voted prefer either of the second two options to the
first one. Nothing more, nothing less.




我应该说更喜欢*后两个选项中的一个,

但它'这与我的观点并不紧密相关......



I should have said "prefer *one* of the second two options",
but it''s not really germane to my point...


这篇关于Python Decorator民意调查的获胜者是......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆