i can't found '_weakref.py',where is '_weakref.py'
from _weakref import (
getweakrefcount,
getweakrefs,
开发者_Python百科 ref,
proxy,
CallableProxyType,
ProxyType,
ReferenceType)
It's not a Python-coded module, it's a C-coded Python-extension module.
You can read the extension module's C source code here.
_weakref
is a C module that comes with Python. Having said that, you should never import a module starting with an underscore directly; import the Python module and let it deal with the C module as needed, in this case weakref
.
精彩评论