日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

python内置函数源码_python如何查看内置函数源码

發布時間:2025/6/17 57 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python内置函数源码_python如何查看内置函数源码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

如題,如何查看python內置函數的源碼

舉個例子:

# 該以什么樣的方式,才能去看xrang的官方源碼實現

for i in xrange(10):

print i

# 直接點進去的話,大多都是一些定義的方法名,而沒有具體實現

# 就是想知道,如何去看具體實現,而不是下面那一堆 pass

class xrange(object):

"""

xrange(stop) -> xrange object

xrange(start, stop[, step]) -> xrange object

Like range(), but instead of returning a list, returns an object that

generates the numbers in the range on demand. For looping, this is

slightly faster than range() and more memory efficient.

"""

def __getattribute__(self, name): # real signature unknown; restored from __doc__

""" x.__getattribute__('name') <==> x.name """

pass

def __getitem__(self, y): # real signature unknown; restored from __doc__

""" x.__getitem__(y) <==> x[y] """

pass

def __init__(self, stop): # real signature unknown; restored from __doc__

pass

def __iter__(self): # real signature unknown; restored from __doc__

""" x.__iter__() <==> iter(x) """

pass

def __len__(self): # real signature unknown; restored from __doc__

""" x.__len__() <==> len(x) """

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

def __reduce__(self, *args, **kwargs): # real signature unknown

pass

def __repr__(self): # real signature unknown; restored from __doc__

""" x.__repr__() <==> repr(x) """

pass

def __reversed__(self, *args, **kwargs): # real signature unknown

""" Returns a reverse iterator. """

pass

總結

以上是生活随笔為你收集整理的python内置函数源码_python如何查看内置函数源码的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。