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的错误吗?