On Feb 12, 12:05 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 12 Feb 2008 15:20:32 -0200, <[EMAIL PROTECTED]> escribi�: > > > > > > > I assert it's easier to write: > > > start_new_thread( this_func ) > > def thrA(): > > normal_suite() > > > than > > > def thrA(): > > normal_suite() > > start_new_thread( thrA ) > > > If you don't, stop reading. If you do, accomplish it like this: > > > @decwrap( start_new_thread, Link, ( 2, 3 ) ) > > def anonfunc( a, b ): > > print( a, b ) > > And I have to *guess* that start_new_thread is called? > A @threaded decorator might be useful, but the above isn't clear at all. > > `import this` inside the interpreter. > > -- > Gabriel Genellina- Hide quoted text - > > - Show quoted text -
No new guessing. It's called in ret= func( *ar2, **kwar2 ) You might suggest a better name, though, than decwrap. Something like @call_here with_specified_function. What? This probably goes under "Complex is better than complicated." It's not a typical decorator, but the f= g( f ) semantics come handily. -- http://mail.python.org/mailman/listinfo/python-list