区分属性和方法 [英] Distinguishing attributes and methods

查看:71
本文介绍了区分属性和方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




随着属性,属性和方法看起来非常相似。我想知道人们使用什么技术为最终用户提供线索

哪些东西是方法,哪些是属性。使用ipython,我

一直使用制表符完成,但我很少能从名称中单独判断

是否是属性或方法。


小贴士?想法?最佳实践?


这是一个想法:Ipython应该根据属性和方法对选项卡完成进行颜色编码


Hi,

With properties, attributes and methods seem very similar. I was
wondering what techniques people use to give clues to end users as to
which ''things'' are methods and which are attributes. With ipython, I
use tab completion all the time, but I can rarely tell from the names
alone whether it is an attribute or method.

Tips? Ideas? Best practices?

Here is one idea: Ipython should color-code the tab completion based
on attributes and methods.

推荐答案

星期五,2007年12月7日23:19:40 -0800,tjhnson写道:
On Fri, 07 Dec 2007 23:19:40 -0800, tjhnson wrote:

使用属性,属性和方法似乎非常相似。我想知道人们使用什么技术为最终用户提供线索

哪些东西是方法,哪些是属性。
With properties, attributes and methods seem very similar. I was
wondering what techniques people use to give clues to end users as to
which ''things'' are methods and which are attributes.



方法是属性。所以决定很简单 -

对象上的所有内容都是属性。 ;-)


Ciao,

Marc''BlackJack''Rintsch

Methods are attributes. So the decision is easy -- everything on an
object is an attribute. ;-)

Ciao,
Marc ''BlackJack'' Rintsch


12月8日,2:10 am,Marc''BlackJack''Rintsch< bj _... @ gmx.netwrote:
On Dec 8, 2:10 am, Marc ''BlackJack'' Rintsch <bj_...@gmx.netwrote:

星期五,2007年12月7日23:19: 40 -0800,tjhnson写道:
On Fri, 07 Dec 2007 23:19:40 -0800, tjhnson wrote:

随着属性,属性和方法看起来非常相似。我想知道人们使用什么技术为最终用户提供线索

哪些东西是方法,哪些是属性。
With properties, attributes and methods seem very similar. I was
wondering what techniques people use to give clues to end users as to
which ''things'' are methods and which are attributes.



方法是属性。所以决定很简单 -

对象上的所有内容都是属性。 ;-)


Ciao,

Marc''BlackJack''Rintsch


Methods are attributes. So the decision is easy -- everything on an
object is an attribute. ;-)

Ciao,
Marc ''BlackJack'' Rintsch



我想他指的是可调用的属性(方法)和不可调用的

属性(变量)。


问候,

Jordan

I think he means callable attributes (methods) and non-callable
attributes (variables).

Regards,
Jordan


2007年12月8日星期六00:34:06 -0800,MonkeeSage写道:
On Sat, 08 Dec 2007 00:34:06 -0800, MonkeeSage wrote:

我认为他的意思是可赎回属性(方法)和不可调用的

属性(变量)。
I think he means callable attributes (methods) and non-callable
attributes (variables).



但并非每个可调用属性都是一种方法。


Ciao,

Marc'' BlackJack''Rintsch

But not every callable attribute is a method.

Ciao,
Marc ''BlackJack'' Rintsch


这篇关于区分属性和方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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