【发布时间】:2016-08-29 19:23:19
【问题描述】:
当我阅读 python 源代码时,我发现了像
这样的内置函数class staticmethod(object):
"""
....
"""
def __getattribute__(self, name): # real signature unknown; restored from __doc__
""" x.__getattribute__('name') <==> x.name """
pass
def __get__(self, obj, type=None): # real signature unknown; restored from __doc__
""" descr.__get__(obj[, type]) -> value """
pass
def __init__(self, function): # real signature unknown; restored from __doc__
pass
@staticmethod # known case of __new__
def __new__(S, *more): # real signature unknown; restored from __doc__
""" T.__new__(S, ...) -> a new object with type S, a subtype of T """
pass
__func__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
我的问题是空方法有什么用?为什么写在这里?
【问题讨论】:
-
请编辑您的帖子并添加更多详细信息,这是哪个库/模块?提及名称。
标签: python