object当中有什么?
1  | class classname(object):  | 
1  | class object:  | 
__doc__: str | None
__doc__方法是python内置方法之一,该方法通常会返回指定对象中的注释部分:
1  | 
  | 
__dict__: dict[str, Any]
__dict__属性在不同的地方有不同的使用:
- 类
__dict__属性:包括静态函数、普通函数、类函数或者全局变量、一些内置属性 - 类对象
__dict__属性:存储了一些self.xxx的一些东西,其中父类与子类对象共用__dict__ - 在字典中是一个字典里面存放的数据
 - 一些内置数据类型是没有
__dict__属性的。比如int、list、dict等这些数据类型 - 继承的时候
__dict__属性中每个类的类变量,函数名都放在自己的__dict__中,实例变量的__dict__中父类和子类对象的__dict__是公用的 
__module__: str
__annotations__: dict[str, Any]
def __class__(self, __type: type[object]) -> None: ...  # noqa: F811
def __init__(self) -> None: ...
def __new__(cls) -> Self: ...
def __setattr__(self, __name: str, __value: Any) -> None: ...
def __delattr__(self, __name: str) -> None: ...
def __eq__(self, __value: object) -> bool: ...
def __ne__(self, __value: object) -> bool: ...
def __str__(self) -> str: ...  # noqa: Y029
def __repr__(self) -> str: ...  # noqa: Y029
def __hash__(self) -> int: ...
def __format__(self, __format_spec: str) -> str: ...
def __getattribute__(self, __name: str) -> Any: ...
def __sizeof__(self) -> int: ...
def __reduce__(self) -> str | tuple[Any, ...]: ...
def __dir__(self) -> Iterable[str]: ...
def __init_subclass__(cls) -> None: ...
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 念念不忘,必有回响!










