问题描述
我不知道你以前是否看过这个,但是这里有:
但是在Python上有一个刺戳,提到Ruby是更多
精致。
-
Ville Vainio
class ThisIs:
avariable =''a''
def amethod(self):
返回''b''
thisis = ThisIs()
打印thisis.avariable
打印thisis.amethod()
导入此
打印读取第2行。
-
Steve C. Lamb |我是你的牧师,我是你的缩水,我是你的
PGP钥匙:8B6E99C5 |与灵魂交换机的主要连接。
------------------------------- + - -------------------------------------------
class Thiss:
avariable =''a''
def amethod(self):
return''b''
thisis = ThisIs()
打印thisis.avariable
打印thisis.amethod()
导入此
打印读取第2行。
我不确定你的观点是什么。如果您说:
打印thisis.amethod
$ b,您的示例不会产生预期结果
$ b而不是
打印thisis.amethod()
这是我发现Ruby语法的地方
很有帮助:我希望方法/
函数对象的时间比*远*低于我想要调用它的时间。
的时间。这是其中一个难题
但似乎没有一个干净的答案。
John Roth
I don''t know if you have seen this before, but here goes:
http://text.userlinux.com/white_paper.html
There is a jab at Python, though, mentioning that Ruby is more
"refined".
--
Ville Vainio http://www.students.tut.fi/~vainio24
class ThisIs:
avariable = ''a''
def amethod(self):
return ''b''
thisis = ThisIs()
print thisis.avariable
print thisis.amethod()
import this
print "Read line 2."
--
Steve C. Lamb | I''m your priest, I''m your shrink, I''m your
PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
class ThisIs:
avariable = ''a''
def amethod(self):
return ''b''
thisis = ThisIs()
print thisis.avariable
print thisis.amethod()
import this
print "Read line 2."
I''m not sure what your point is. Your example isn''t going
to produce the expected result if you say:
print thisis.amethod
instead of
print thisis.amethod()
That is the place where I find Ruby syntax to be
helpful: the amount of time where I want the method /
function object is *far* lower than the amount of
time I want to call it. It''s one of those conundrums
that doesn''t seem to have a clean answer, though.
John Roth
这篇关于UserLinux选择Python作为“解释性语言”。选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!