#NEWLINE# def test_curry_is_idempotent( ) : #NEWLINE# #INDENT# def foo( a , b , c = 1 ) : #NEWLINE# #INDENT# return ( ( a + b ) + c ) #NEWLINE# #UNINDENT# f = curry ( foo , 1 , c = 2 ) #NEWLINE# g = curry ( f ) #NEWLINE# assert isinstance ( f , curry ) #NEWLINE# assert isinstance ( g , curry ) #NEWLINE# assert ( not isinstance ( g . func , curry ) ) #NEWLINE# assert ( not hasattr ( g . func , 'func' ) ) #NEWLINE# assert ( f . func == g . func ) #NEWLINE# assert ( f . args == g . args ) #NEWLINE# assert ( f . keywords == g . keywords )