Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Request for review: Decorator implementation example #134500

Closed as not planned
Closed as not planned
@ShengDong207

Description

@ShengDong207

I'm learning about Python decorators and would appreciate feedback on my implementation.

Here's my example code:

@timerdefslow_function():importtimetime.sleep(2)return"Done"

Specifically, I'd like to know:

  1. Is this a correct usage of decorators?
  2. What's missing from the implementation (I notice the@timer decorator itself isn't defined)
  3. Best practices for implementing timing decorators

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp