Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8045759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:38:13+00:00 2026-06-05T05:38:13+00:00

Are there any accepted naming conventions for the innards of Python decorators? The style

  • 0

Are there any “accepted” naming conventions for the innards of Python decorators?

The style guide doesn’t mention it, and this awesome entry about decorators is pretty consistent in using variants of “wrapped” for the ultimate function that is returned, but what about the names used when creating decorators that take arguments?

def decorator_name(whatevs):
    def inner(function):
        def wrapped(*args, **kwargs):
            # sweet decorator goodness
        return wrapped
    return inner

Specifically, what are the conventions for inner, function, and wrapped in the above example?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:38:14+00:00Added an answer on June 5, 2026 at 5:38 am

    There are no standardized conventions (such as PEPs) for those names. If you check the python stdlib you’ll find lots of different names for those functions.

    However, decorator is a rather common name for the decorator function inner.
    It is also common to call your wrapped function wrapper and decorate it with functools.wraps(f) with f being the wrapped function (func is also a common name for it).

    def decorator_name(whatevs):
        def decorator(f):
            @wraps(f)
            def wrapper(*args, **kwargs):
                pass # sweet decorator goodness
            return wrapper
        return decorator
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any generally-accepted coding standards (naming, casting etc) that apply specifically to iPhone/Cocoa/Objective-C?
Is there any accepted convention for naming war files? Jar files seem to follow
I'm sure this question is fairly simple to answer... is there any way to
In a standard foreach loop, is there a generally accepted naming convention for the
Is there any generally accepted, proven-to-work way using hibernate, that keeps a history of
Are there any currently accepted methods for building full screen web applications in HTML
Are there any additional parameters besides the message accepted by the alert / confirm
Is there any libraries for this? I will put this on a server and
any help you can give is very gratefully accepted. I've been looking at this
Wondering if there's any accepted practice for approximating C++'s 'const methods' in Objective-C. (new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.