Skip to content

Commit

Permalink
refactor: add @wraps to timer_decorator for better function metadata …
Browse files Browse the repository at this point in the history
…preservation
  • Loading branch information
oedokumaci committed Jan 4, 2025
1 parent 3ace282 commit 1332528
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/template_python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
from collections.abc import Callable
from datetime import datetime
from functools import wraps
from pathlib import Path
from time import time

Expand Down Expand Up @@ -71,6 +72,7 @@ def timer_decorator(func: Callable[P, R]) -> Callable[P, R]:
Callable[P, R]: The decorated function.
"""

@wraps(func)
def wrapper(*args: P.args, **kwargs: P.kwargs) -> R:
"""Wrapper function that prints the time it took to execute a function.
Expand Down

0 comments on commit 1332528

Please sign in to comment.