It took me a while to figure this one out:
def f(x):
return(x)
@require(f):
def g(y):
return f(y)
gives:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-86-98a37b0c736a> in <module>()
----> 1 @require(f)
2 def g(y):
3 return f(y)
4
/usr/local/lib/python2.7/dist-packages/IPython/parallel/controller/dependency.pyc in require(*objects, **mapping)
133 for name, obj in mapping.items():
134 mapping[name] = can(obj)
--> 135 return depend(_require, *names, **mapping)
136
137 class Dependency(set):
TypeError: __init__() got multiple values for keyword argument 'f'
I believe the cause is the use of f as a name in the constructor here.
This seems like a bit of an arbitrary restriction; it may not be possible to get around having to forbid the use of some function name, but at least we could maybe use something less likely to collide with users' things (_f maybe?).
It took me a while to figure this one out:
gives:
I believe the cause is the use of
fas a name in the constructor here.This seems like a bit of an arbitrary restriction; it may not be possible to get around having to forbid the use of some function name, but at least we could maybe use something less likely to collide with users' things (
_fmaybe?).