'id'是Python中错误的变量名

布莱恩·巴克:

为什么id在Python中命名变量很不好

凯文·利特尔(Kevin Little):

id() 是一个基本的内置:

帮助id模块中的内置功能__builtin__

id(...)

    id(object) -> integer

    Return the identity of an object.  This is guaranteed to be unique among
    simultaneously existing objects.  (Hint: it's the object's memory
    address.)

通常,即使允许使用使用任何语言使关键字或内置函数都黯然失色的变量名也是一个坏主意。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章