#NEWLINE# def test_curry_kwargs( ) : #NEWLINE# #INDENT# def f( a , b , c = 10 ) : #NEWLINE# #INDENT# return ( ( a + b ) * c ) #NEWLINE# #UNINDENT# f = curry ( f ) #NEWLINE# assert ( f ( 1 , 2 , 3 ) == 9 ) #NEWLINE# assert ( f ( 1 ) ( 2 , 3 ) == 9 ) #NEWLINE# assert ( f ( 1 , 2 ) == 30 ) #NEWLINE# assert ( f ( 1 , c = 3 ) ( 2 ) == 9 ) #NEWLINE# assert ( f ( c = 3 ) ( 1 , 2 ) == 9 ) #NEWLINE# def g( a = 1 , b = 10 , c = 0 ) : #NEWLINE# #INDENT# return ( ( a + b ) + c ) #NEWLINE# #UNINDENT# cg = curry ( g , b = 2 ) #NEWLINE# assert ( cg ( ) == 3 ) #NEWLINE# assert ( cg ( b = 3 ) == 4 ) #NEWLINE# assert ( cg ( a = 0 ) == 2 ) #NEWLINE# assert ( cg ( a = 0 , b = 1 ) == 1 ) #NEWLINE# assert ( cg ( 0 ) == 2 ) #NEWLINE# assert raises ( TypeError , ( lambda : cg ( 1 , 2 ) ) )