我正在學習python正則表達式(re.py
)的源代碼。我在哪裏可以找到_sre.py python內置模塊?
在re.py
它們導入模塊sre_compile
:
import sre_compile
,我期待在模塊sre_compile那裏,他們進口的模塊_sre
在13
import _sre, sys
我搜索模塊的那行_sre.py
但我找不到任何地方,我甚至試圖
找到我的shell中的_sre.py
。
最後我試圖用python解釋器找到它。我進口_sre
,我試圖尋找的_sre
的__file__
屬性,但它給了我下面的錯誤:
AttributeError: 'module' object has no attribute '__file__'
我在哪裏可以找到_sre
模塊的源代碼?
投票重新開放。這個問題不是要求推薦或鏈接;它特別要求在Python源代碼*中存在'_sre'的位置*。 (他們需要幫助找到它的具體原因。) – duskwuff