python, Object是python下的一個(gè)函數(shù),具體來說就是object類,屬于所有類的父類。簡(jiǎn)單來說,任何其他類都直接或間接繼承object類的屬性和方法。
用法是object()
參數(shù):
None
參考示例:
演示object()的工作,并輸入命令:
# Python 3 code to demonstrate
# working of object()
# declaring the object of class object
obj=object()
# printing its type
print (The type of object class object is:)
print (type(obj))
# printing its attributes
print (The attributes of its class are:)
print (dir(obj))
輸出結(jié)果:
The type of object class object is:
The attributes of its class are:
['__class__ '' __delattr__ '' __dir__ '' __doc__ '' __eq__ '' __format__ '' __getattribute__ '' __hash__ '' __init__ '' __le__ '' __lt__ '' __ne__ '' __new__ '' __reduce__ ''' __reduce_ex__ '
以上是邊肖的分享,希望對(duì)大家有所幫助。
python,以上就是本文為您收集整理的python最新內(nèi)容,希望能幫到您!更多相關(guān)內(nèi)容歡迎關(guān)注。