Skip to content

Fate of original function properties when function is wrapped #1308

@paroche

Description

@paroche

In the Summary, you have:

"It is generally safe to replace a function or a method with a decorated one, except for one little thing. If the original function had properties on it, like func.calledCount or whatever, then the decorated one will not provide them. Because that is a wrapper. So one needs to be careful if one uses them. Some decorators provide their own properties."

I don't think this is covered in the body of the article (I could be wrong, but I've read it a few times), and I think it would be useful if it were.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions