[ create a new paste ] login | about

Link: http://codepad.org/RtfNmKCC    [ raw code | fork ]

Python, pasted on Dec 9:
from operators import add


partial = block(func, *args,
    block(*a, func(*(args + a)))
)

partial(add, 10)(1)
# Blows up with:
#
#  AttributeError: Locals has no attribute 'args'
#    ---------------
#    *(args +(a))
#    func(*(args +(a)))
#    f(1) 


partial2 = block(func, *args,
    block(*a, func(*(self args + a)))
)

partial2(add, 10)(1)
# Returns 1 (not 11)


Create a new paste based on this one


Comments: