Ipython 0.13.1可以打印來自python庫的對象的源碼,
如os.path.abspath?
但我無法打印通過ipython通過%ed魔法定義的任何對象的源代碼,
我做了什麼錯誤?
如 ,我定義一個類名稱通過%ED魔:如何打印我定義的對象的源代碼使用%編輯魔術
%ed
然後
class Name(object):
"""docstring for Name"""
name = 'hong'
def __init__(self, arg):
super(Name, self).__init__()
self.arg = arg
def pri():
print 'class Name'
當回IPython的,也看不出類名稱的源代碼:
In [59]: Name??
Type: type
String Form:<class '__main__.Name'>
Docstring: docstring for Name
Constructor information:
Definition:Name(self, arg)
這是IPython的bug嗎?
不使用筆記本,我只使用IPython shell,而我的意思是IPython shell –
的問題啊,對於疏忽感到抱歉。我現在修改了答案,尋找可能有助於他人解決問題的錯誤消息。 –
謝謝,我已經重新編輯它。 –