You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
generics.complete_object appears to be broken in the trunk (0.11alpha). It keeps returning TryNext in situations where it should not. As a result, it is proving to be very difficult to support some custom completers with the forthcoming ipython-0.11:
In [12]: generics.complete_object('foo', dir('foo'))
---------------------------------------------------------------------------
TryNext Traceback (most recent call last)
/Users/darren/Projects/phynx.git/<ipython console> in <module>()
/Users/darren/Projects/ipython/IPython/external/simplegeneric.pyc in dispatch(*args, **kw)
73 f = _gbt(t, _sentinel)
74 if f is not _sentinel:
---> 75 return f(*args, **kw)
76 else:
77 return func(*args, **kw)
/Users/darren/Projects/ipython/IPython/utils/generics.pyc in complete_object(obj, prev_completions)
60 own_attrs + prev_completions.
61 """
---> 62 raise TryNext
63
64
TryNext:
The text was updated successfully, but these errors were encountered:
It's not clear if the original reporter was attempting to use this correctly. complete_objects is a generic, and should be extended like this:
@generics.complete_object.when_type(MyClass):
def f(myclass_obj, prev_completions):
return #Stuff from myclass_obj
(there's also a when_object decorator for specific objects)
The TryNext errors are raised when it doesn't find a matching type or object to dispatch to, and appear to be caught in core/completer.py (line 372). So I'm not sure that this is actually a bug.
Original Launchpad bug 527968: https://bugs.launchpad.net/ipython/+bug/527968
Reported by: dsdale24 (Darren Dale).
generics.complete_object appears to be broken in the trunk (0.11alpha). It keeps returning TryNext in situations where it should not. As a result, it is proving to be very difficult to support some custom completers with the forthcoming ipython-0.11:
The text was updated successfully, but these errors were encountered: