We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_
When I try to execute following code it throwing an error:
In [49]: from fn import _ In [50]: from fn import F In [51]: f = F() In [52]: a = f >> _.split >> _(',') In [53]: a('1,2,3') --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-53-3db68dd60b11> in <module>() ----> 1 a('1,2,3') /path/to/package/fn/func.pyc in __call__(self, *args, **kwargs) 53 def __call__(self, *args, **kwargs): 54 """Overload apply operator""" ---> 55 return self.f(*args, **kwargs) 56 57 /path/to/package/fn/func.pyc in <lambda>(*args, **kwargs) 34 in other methods. 35 """ ---> 36 return cls(lambda *args, **kwargs: f(g(*args, **kwargs))) 37 38 def __ensure_callable(self, f): TypeError: 'str' object is not callable
I expect that previous code should works like this:
a = lambda x: x.split(',')
Actually it works if we rewrite it a little bit:
In [61]: from fn import _ In [62]: from fn import F In [63]: f = F() In [64]: a = f >> _.split >> (lambda x: x(',')) In [65]: a('1,2,3') Out[65]: ['1', '2', '3']
So, the problem in the method _Callable.__call__. By default _calback=identity and we have following:
_Callable.__call__
_calback=identity
In [6]: from fn import _ In [7]: _(',') Out[7]: ','
The text was updated successfully, but these errors were encountered:
See kachayev#79
Sorry, something went wrong.
No branches or pull requests
When I try to execute following code it throwing an error:
I expect that previous code should works like this:
Actually it works if we rewrite it a little bit:
So, the problem in the method
_Callable.__call__
.By default
_calback=identity
and we have following:The text was updated successfully, but these errors were encountered: