如何在Python3中找到os.scandir的源代码?

时间:2018-07-04 06:28:34

标签: python python-3.x python-3.6

嗯,这与我的another question有点关系。

在所有获取功能来源的方法中:

  • getsource无法正常工作
  • os.scandir没有__file__属性,因此不能仅仅os.scandir.__file__
  • 通过source file in python github repo进行扫描不会显示任何有趣的内容。

任何建议将不胜感激。

1 个答案:

答案 0 :(得分:1)

From the documentation

  

在基于Unix的系统上,scandir()使用系统的opendir()和readdir()函数。在Windows上,它使用Win32 FindFirstFileW和FindNextFileW函数。

如果您想了解幕后发生的事情,我建议您看看。

相关问题