python3 面向?qū)ο骭_類的內(nèi)置屬性與方法的實(shí)例代碼
0.object類源碼
class object:
""" The most base type """
def __delattr__(self, *args, **kwargs): # real signature unknown
""" Implement delattr(self, name). """
pass
def __dir__(self): # real signature unknown; restored from __doc__
"""
__dir__() -> list
default dir() implementation
"""
return []
def __eq__(self, *args, **kwargs): # real signature unknown
""" Return self==value. """
pass
def __format__(self, *args, **kwargs): # real signature unknown
""" default object formatter """
pass
def __getattribute__(self, *args, **kwargs): # real signature unknown
""" Return getattr(self, name). """
pass
def __ge__(self, *args, **kwargs): # real signature unknown
""" Return self>=value. """
pass
def __gt__(self, *args, **kwargs): # real signature unknown
""" Return self>value. """
pass
def __hash__(self, *args, **kwargs): # real signature unknown
""" Return hash(self). """
pass
def __init_subclass__(self, *args, **kwargs): # real signature unknown
"""
This method is called when a class is subclassed.
The default implementation does nothing. It may be
overridden to extend subclasses.
"""
pass
def __init__(self): # known special case of object.__init__
""" Initialize self. See help(type(self)) for accurate signature. """
pass
def __le__(self, *args, **kwargs): # real signature unknown
""" Return self<=value. """
pass
def __lt__(self, *args, **kwargs): # real signature unknown
""" Return self<value. """
pass
@staticmethod # known case of __new__
def __new__(cls, *more): # known special case of object.__new__
""" Create and return a new object. See help(type) for accurate signature. """
pass
def __ne__(self, *args, **kwargs): # real signature unknown
""" Return self!=value. """
pass
def __reduce_ex__(self, *args, **kwargs): # real signature unknown
""" helper for pickle """
pass
def __reduce__(self, *args, **kwargs): # real signature unknown
""" helper for pickle """
pass
def __repr__(self, *args, **kwargs): # real signature unknown
""" Return repr(self). """
pass
def __setattr__(self, *args, **kwargs): # real signature unknown
""" Implement setattr(self, name, value). """
pass
def __sizeof__(self): # real signature unknown; restored from __doc__
"""
__sizeof__() -> int
size of object in memory, in bytes
"""
return 0
def __str__(self, *args, **kwargs): # real signature unknown
""" Return str(self). """
pass
@classmethod # known case
def __subclasshook__(cls, subclass): # known special case of object.__subclasshook__
"""
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__().
It should return True, False or NotImplemented. If it returns
NotImplemented, the normal algorithm is used. Otherwise, it
overrides the normal algorithm (and the outcome is cached).
"""
pass
__class__ = None # (!) forward: type, real value is ''
__dict__ = {}
__doc__ = ''
__module__ = ''
1.內(nèi)置屬性說(shuō)明
①__class__:說(shuō)明對(duì)象處于模塊中的哪一個(gè)類
②[類名].__dict__:打印類的所有屬性與方法(包括繼承自基類的屬性和方法)(包括內(nèi)置屬性和方法)
[對(duì)象].__dict__:打印對(duì)象的所有屬性(私有和公有)
總結(jié)
以上所述是小編給大家介紹的python3 面向?qū)ο骭_類的內(nèi)置屬性與方法的實(shí)例代碼,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
- Python使用內(nèi)置函數(shù)setattr設(shè)置對(duì)象的屬性值
- Python List列表對(duì)象內(nèi)置方法實(shí)例詳解
- Python序列對(duì)象與String類型內(nèi)置方法詳解
- Python面向?qū)ο笾惖膬?nèi)置attr屬性示例
- Python統(tǒng)計(jì)可散列的對(duì)象之容器Counter詳解
- Python面向?qū)ο蠓庋b繼承和多態(tài)示例講解
- python學(xué)習(xí)之可迭代對(duì)象、迭代器、生成器
- Python解析JSON對(duì)象的全過(guò)程記錄
- Python中對(duì)象的比較操作==和is區(qū)別詳析
- 淺談Python中的常用內(nèi)置對(duì)象
相關(guān)文章
解決pandas .to_excel不覆蓋已有sheet的問(wèn)題
今天小編就為大家分享一篇解決pandas .to_excel不覆蓋已有sheet的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2018-12-12
Python數(shù)據(jù)類型最全知識(shí)總結(jié)
學(xué)習(xí)一門語(yǔ)言,往往都是從Hello World開始. 但是筆者認(rèn)為,在一個(gè)黑框框中輸出一個(gè)“你好,世界”并沒(méi)有什么了不起,要看透事物的本質(zhì),熟悉一門語(yǔ)言,就要了解其底層,就是我們常常說(shuō)的基礎(chǔ),本篇從python中的數(shù)據(jù)類型開始,需要的朋友可以參考下2021-05-05
Python OpenCV 基于圖像邊緣提取的輪廓發(fā)現(xiàn)函數(shù)
這篇文章主要介紹了Python OpenCV 基于圖像邊緣提取的輪廓發(fā)現(xiàn)函數(shù),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2021-03-03
Python中urlencode()函數(shù)構(gòu)建URL查詢字符串的利器學(xué)習(xí)
這篇文章主要為大家介紹了Python中urlencode()函數(shù)構(gòu)建URL查詢字符串的利器學(xué)習(xí),有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-10-10
Python讀取HTML中的canvas并且以圖片形式存入Word文檔
這篇文章主要介紹了Python讀取HTML中的canvas并且以圖片形式存入Word文檔,文章圍繞主題展開詳細(xì)的內(nèi)容介紹,具有一定的參考價(jià)值,需要的小伙伴可以參考一下2022-08-08
Python爬蟲實(shí)現(xiàn)的根據(jù)分類爬取豆瓣電影信息功能示例
這篇文章主要介紹了Python爬蟲實(shí)現(xiàn)的根據(jù)分類爬取豆瓣電影信息功能,結(jié)合完整實(shí)例形式分析了Python針對(duì)電影信息分類抓取的相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2019-09-09

