diff --git a/IPython/core/tests/test_completer.py b/IPython/core/tests/test_completer.py index 56428ba..74c53ad 100644 --- a/IPython/core/tests/test_completer.py +++ b/IPython/core/tests/test_completer.py @@ -115,7 +115,7 @@ def test_custom_completion_error(): class A(object): pass ip.user_ns['a'] = A() - @complete_object.when_type(A) + @complete_object.register(A) def complete_A(a, existing_completions): raise TypeError("this should be silenced") diff --git a/IPython/external/__init__.py b/IPython/external/__init__.py index 3104c19..1c8c546 100644 --- a/IPython/external/__init__.py +++ b/IPython/external/__init__.py @@ -2,4 +2,4 @@ This package contains all third-party modules bundled with IPython. """ -__all__ = ["simplegeneric"] +__all__ = [] diff --git a/IPython/utils/generics.py b/IPython/utils/generics.py index 5ffdc86..fcada6f 100644 --- a/IPython/utils/generics.py +++ b/IPython/utils/generics.py @@ -1,20 +1,18 @@ # encoding: utf-8 """Generic functions for extending IPython. - -See http://pypi.python.org/pypi/simplegeneric. """ from IPython.core.error import TryNext -from simplegeneric import generic +from functools import singledispatch -@generic +@singledispatch def inspect_object(obj): """Called when you do obj?""" raise TryNext -@generic +@singledispatch def complete_object(obj, prev_completions): """Custom completer dispatching for python objects. @@ -30,5 +28,3 @@ def complete_object(obj, prev_completions): own_attrs + prev_completions. """ raise TryNext - - diff --git a/IPython/utils/text.py b/IPython/utils/text.py index 0c0d82f..e844203 100644 --- a/IPython/utils/text.py +++ b/IPython/utils/text.py @@ -81,7 +81,7 @@ class LSString(str): # print arg # # -# print_lsstring = result_display.when_type(LSString)(print_lsstring) +# print_lsstring = result_display.register(LSString)(print_lsstring) class SList(list): @@ -243,7 +243,7 @@ class SList(list): # # nlprint(arg) # This was a nested list printer, now removed. # -# print_slist = result_display.when_type(SList)(print_slist) +# print_slist = result_display.register(SList)(print_slist) def indent(instr,nspaces=4, ntabs=0, flatten=False): diff --git a/setup.py b/setup.py index 78529cf..47c9af2 100755 --- a/setup.py +++ b/setup.py @@ -188,7 +188,6 @@ install_requires = [ 'jedi>=0.10', 'decorator', 'pickleshare', - 'simplegeneric>0.8', 'traitlets>=4.2', 'prompt_toolkit>=2.0.0,<2.1.0', 'pygments',