diff --git a/nbdev/__init__.py b/nbdev/__init__.py index 8e375122..bd799b77 100644 --- a/nbdev/__init__.py +++ b/nbdev/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.3.35" +__version__ = "2.3.36" from .doclinks import nbdev_export from .showdoc import show_doc diff --git a/nbdev/showdoc.py b/nbdev/showdoc.py index 7361ca44..8f317ace 100644 --- a/nbdev/showdoc.py +++ b/nbdev/showdoc.py @@ -7,13 +7,13 @@ from .doclinks import * from .config import get_config -from fastcore.dispatch import TypeDispatch from fastcore.docments import * from fastcore.utils import * from importlib import import_module import inspect, sys from collections import OrderedDict +from plum import Function from textwrap import fill from types import FunctionType @@ -189,7 +189,7 @@ def show_doc(sym, # Symbol to document elif isinstance(renderer,str): p,m = renderer.rsplit('.', 1) renderer = getattr(import_module(p), m) - if isinstance(sym, TypeDispatch): pass + if isinstance(sym, Function): pass else:return renderer(sym or show_doc, name=name, title_level=title_level) # %% ../nbs/api/08_showdoc.ipynb diff --git a/nbs/api/08_showdoc.ipynb b/nbs/api/08_showdoc.ipynb index 8f25cfcf..29b2179e 100644 --- a/nbs/api/08_showdoc.ipynb +++ b/nbs/api/08_showdoc.ipynb @@ -32,13 +32,13 @@ "from nbdev.doclinks import *\n", "from nbdev.config import get_config\n", "\n", - "from fastcore.dispatch import TypeDispatch\n", "from fastcore.docments import *\n", "from fastcore.utils import *\n", "\n", "from importlib import import_module\n", "import inspect, sys\n", "from collections import OrderedDict\n", + "from plum import Function\n", "from textwrap import fill\n", "from types import FunctionType" ] @@ -648,7 +648,7 @@ " elif isinstance(renderer,str):\n", " p,m = renderer.rsplit('.', 1)\n", " renderer = getattr(import_module(p), m)\n", - " if isinstance(sym, TypeDispatch): pass\n", + " if isinstance(sym, Function): pass\n", " else:return renderer(sym or show_doc, name=name, title_level=title_level)" ] }, @@ -1334,7 +1334,7 @@ "outputs": [], "source": [ "#|hide\n", - "from fastcore.dispatch import typedispatch" + "from plum import dispatch" ] }, { @@ -1345,7 +1345,7 @@ "outputs": [], "source": [ "#|hide\n", - "@typedispatch\n", + "@dispatch\n", "def _typ_test(\n", " a:list, # A list\n", " b:str, # A second integer\n", @@ -1353,7 +1353,7 @@ " \"Perform op\"\n", " return a.extend(b)\n", "\n", - "@typedispatch\n", + "@dispatch\n", "def _typ_test(\n", " a:str, # An integer\n", " b:str # A str\n", @@ -1361,7 +1361,7 @@ " \"Perform op\"\n", " return str(a) + b\n", "\n", - "test_eq(show_doc(_typ_test), None) # show_doc ignores typedispatch at the moment" + "test_eq(show_doc(_typ_test), None) # show_doc ignores dispatch at the moment" ] }, { diff --git a/settings.ini b/settings.ini index 8d766f21..a66af8bb 100644 --- a/settings.ini +++ b/settings.ini @@ -9,13 +9,13 @@ author = Jeremy Howard and Hamel Husain author_email = j@fast.ai branch = master min_python = 3.7 -version = 2.3.35 +version = 2.3.36 audience = Developers language = English custom_sidebar = True license = apache2 status = 5 -requirements = fastcore>=1.5.27 execnb>=0.1.4 astunparse ghapi>=1.0.3 watchdog asttokens setuptools +requirements = fastcore>=1.5.27 execnb>=0.1.12 astunparse ghapi>=1.0.3 watchdog asttokens setuptools plum-dispatch pip_requirements = PyYAML conda_requirements = pyyaml conda_user = fastai