我是想看看我能不能叫蟒蛇类的私有函数,我想在IPython中:python类未能提供_Secretive__xxx()函数,为什么?
In [14]: class C:
....: def __my(s):
....: print "hello"
....:
In [15]: print C
__main__.C
In [16]: obj=C()
In [17]: obj._Secretive__my
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-17-c68d82fedeb4> in <module>()
----> 1 obj._Secretive__my
AttributeError: C instance has no attribute '_Secretive__my'
In [18]: obj._Secretive__my()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-18-ab4a9965f82a> in <module>()
----> 1 obj._Secretive__my()
嗯,看来我无法统计,或调用它,对吗?我哪里错了?