I admit, my previous attempt really wasn't very intuitive all things considered. ;)

How about this:

@error_handler(bind_args(foo=123)(my_method))

This even works with decorator syntax.

Committed in r760. In addition I have moved bind_args from errorhadnilg to util as it's now a completely generic function.

Cheers,
Simon

Michele Cella wrote:
Jorge Godoy wrote:
I find it "counter intuitive" having parameters _before_ the function I'm
calling...  I'd rather see the dictionary implementation suggested by Michele:

    @turbogears.error_handler(method, arg1=value1, arg2=value2, argn=valuen)

This looks much more intuitive...  But I dunno how hard it is to implement
that.  Another options that would be more intuitive than using bing_args is:

    @turbogears.error_handler(method)(arg1=value1, arg2=value2, argn=valuen)


I haven't got a change to play with bind_args, anyway I agree with
Jorge that it seems a bit unintuitive to me (it also, somewhat, makes
more difficult to recognize the error_handler decorator presence), if
possible my preference goes to the last solution provided by Jorge as
it seems the most clean, again I'm not sure if it's doable.

Thanks again Simon.

Ciao
Michele


Reply via email to