fnpy / fn.py

Missing features of fp in Python -- active fork of kachayev/fn.py
Other
149 stars 14 forks source link

Weired behavior of underscore shortcut #31

Closed mikebohdan closed 7 years ago

mikebohdan commented 7 years ago

When I created new lambda with _ underscore also mutates to that value:

In [1]: from fn import _

In [2]: _(",")
Out[2]: ','

In [3]: _
Out[3]: ','

Or

In [10]: from fn import _

In [11]: a = _ + 1

In [12]: a
Out[12]: (_ + 1)

In [13]: _
Out[13]: (_ + 1)

In [14]: a(1)
Out[14]: 2

In [15]: _
Out[15]: 2

I think '_' shouldn't be affected by calling external functions (like in 2 example) or calling itself.