-
-
Notifications
You must be signed in to change notification settings - Fork 189
Closed
Labels
Milestone
Description
tested in python 3.6.9. dill.source.getsource fails to recognize a function defined in the current session. (using most current bleeding edge build of dill).
Works in python:
Python 3.6.9 (default, Sep 7 2019, 21:14:28)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dill
>>>
>>> def squared(x):
... return x*x
...
>>> dill.source.getsource(squared)
'def squared(x):\n return x*x\n'
>>>
Fails in ipython:
Python 3.6.9 (default, Sep 7 2019, 21:14:28)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import dill
In [2]: def squared(x):
...: return x*x
...:
In [3]: dill.source.getsource(squared)[:20]
Out[3]: '_HiStOrY_V2_\nimport\\'
Reactions are currently unavailable