当我阅读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我的问题是,空方法是用来做什么的?为什么要写在这里?
发布于 2016-05-04 19:52:17
Python的一些(可能大部分)内置函数是用C编写的,因此没有针对它们的Python实现。
https://stackoverflow.com/questions/37026312
复制相似问题