2024-05-19 17:06:53 发布
网友
我刚读完http://python.net/crew/mwh/hacks/objectthink.html和http://nedbatchelder.com/text/names.html。你知道吗
现在有一个问题,Python值总是对象吗(对象是名称唯一可以绑定的对象吗?)而且,在PyTown中对象是唯一的游戏吗…因为语言没有原语,对吗?你知道吗
是的,一路都是物体。你知道吗
例如,整数具有以下方法:
>>> 1 .__str__ <method-wrapper '__str__' of int object at 0x104ad7820>
功能也是如此:
>>> def foo(): pass ... >>> foo.__str__ <method-wrapper '__str__' of function object at 0x104e62830>
是的,一路都是物体。你知道吗
例如,整数具有以下方法:
功能也是如此:
相关问题 更多 >
编程相关推荐