Re: Decorators not worth the effort

Discussion in 'Python' started by Jean-Michel Pichavant, Sep 19, 2012.

  1. ----- Original Message -----
    > Jean-Michel Pichavant <> writes:
    >
    > > ----- Original Message -----
    > >> Jean-Michel Pichavant wrote:

    > > [snip]
    > >> One minor note, the style of decorator you are using loses the
    > >> docstring
    > >> (at least) of the original function. I would add the
    > >> @functools.wraps(func)
    > >> decorator inside your decorator.

    > >
    > > Is there a way to not loose the function signature as well ?

    >
    > Look at the "decorator" module.
    >


    Great, thank you.

    JM
    Jean-Michel Pichavant, Sep 19, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jean-Michel Pichavant

    Re: Decorators not worth the effort

    Jean-Michel Pichavant, Sep 14, 2012, in forum: Python
    Replies:
    4
    Views:
    187
    Steve Howell
    Sep 15, 2012
  2. Jean-Michel Pichavant

    Re: Decorators not worth the effort

    Jean-Michel Pichavant, Sep 14, 2012, in forum: Python
    Replies:
    1
    Views:
    131
    Steven D'Aprano
    Sep 14, 2012
  3. andrea crotti

    Re: Decorators not worth the effort

    andrea crotti, Sep 14, 2012, in forum: Python
    Replies:
    0
    Views:
    131
    andrea crotti
    Sep 14, 2012
  4. Chris Angelico

    Re: Decorators not worth the effort

    Chris Angelico, Sep 14, 2012, in forum: Python
    Replies:
    2
    Views:
    149
    88888 Dihedral
    Sep 14, 2012
  5. Jean-Michel Pichavant

    Re: Decorators not worth the effort

    Jean-Michel Pichavant, Sep 14, 2012, in forum: Python
    Replies:
    0
    Views:
    128
    Jean-Michel Pichavant
    Sep 14, 2012
Loading...

Share This Page