如何在 iPython 中使用 deepreload 进行自动重载

sam*_*mol 5 python ipython jupyter jupyter-notebook

我目前使用它在 python 中自动重新加载

%reload_ext autoreload
%autoreload 2
Run Code Online (Sandbox Code Playgroud)

但是,我想开始使用 deepreload (https://ipython.org/ipython-doc/3/api/ generated/IPython.lib.deepreload.html )

但是下面的方法不起作用:

import builtins
from IPython.lib import deepreload
builtins.reload = deepreload.reload

%reload_ext autoreload
%autoreload 2
Run Code Online (Sandbox Code Playgroud)

如何在 jupyter 中获得深度自动重载

she*_*idp 4

只需颠倒顺序即可

%load_ext autoreload
%autoreload 2

import builtins
from IPython.lib import deepreload
builtins.reload = deepreload.reload
Run Code Online (Sandbox Code Playgroud)