移除自我的建议 [英] Proposal for removing self

查看:67
本文介绍了移除自我的建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在做面向对象的事情时,我不得不输入self字样。所以

多次。我建议Python允许程序员选择输入

" .variable"而不是自我变量而不是自变量。意思是同样的事情。当然,解释器必须更加小心地检测浮点数,而这些浮点数只需要一段时间,如.5所示。你有什么想法?

When doing object-oriented stuff, it bothers me to have to type "self" so
many times. I propose that Python allow the programmer to optionally type
".variable" instead of "self.variable" to mean the same thing. Of course,
the interpreter would have to be more careful about detecting floats that
begin with just a period as in ".5". What are your thoughts?

推荐答案

Brent W. Hughes写道:
Brent W. Hughes wrote:
当做面向对象的东西时,它困扰我必须输入
self很多次。我建议Python允许程序员选择性地键入.variable。而不是自我变量而不是自变量。意思是
同样的事情。当然,翻译人员必须更加小心地检测那些以.5开始的浮动片段。
你有什么想法?
When doing object-oriented stuff, it bothers me to have to type
"self" so many times. I propose that Python allow the programmer to
optionally type ".variable" instead of "self.variable" to mean the
same thing. Of course, the interpreter would have to be more careful
about detecting floats that begin with just a period as in ".5".
What are your thoughts?




当我开始做Python时,它让我恼火。多年以后

我肯定不会改变它。 Guido味道很好!


Roger



When I started doing Python, it annoyed me. Now many years later
I definitely wouldn''t change it. Guido has very good taste!

Roger


" Brent W. Hughes" <峰; br ********** @ comcast.net>在消息新闻中写道:< T_7Xc.61360
"Brent W. Hughes" <br**********@comcast.net> wrote in message news:<T_7Xc.61360


Fg5.2281@attbi_s53> ...
Fg5.2281@attbi_s53>...
当做面向对象的事情时,让我烦恼不已输入自我好多次。我建议Python允许程序员选择键入
.variable。而不是自我变量而不是自变量。意思是同样的事情。当然,解释器必须更加小心地检测以.5开始的一段时间才开始的浮动。你有什么想法?
When doing object-oriented stuff, it bothers me to have to type "self" so
many times. I propose that Python allow the programmer to optionally type
".variable" instead of "self.variable" to mean the same thing. Of course,
the interpreter would have to be more careful about detecting floats that
begin with just a period as in ".5". What are your thoughts?




有关于这个主题的常见问题解答:

http:// www。 python.org/doc/faq/genera...ions-and-calls

Raymond Hettinger



There''s a FAQ on the subject:

http://www.python.org/doc/faq/genera...ions-and-calls
Raymond Hettinger


这篇关于移除自我的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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