Skip to content

Commit 2d93a65

Browse files
committed
typing
1 parent c20429b commit 2d93a65

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sentry_sdk/tracing.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,13 +1341,15 @@ def _set_initial_sampling_decision(self, sampling_context):
13411341
if TYPE_CHECKING:
13421342

13431343
@overload
1344-
def trace(*, op=None, name=None, attributes=None):
1345-
# type: (Optional[str], Optional[str], Optional[dict[str, Any]]) -> Callable[[Callable[P, R]], Callable[P, R]]
1344+
def trace(func):
1345+
# type: (Callable[P, R]) -> Callable[P, R]
1346+
# Handles: @trace
13461347
pass
13471348

13481349
@overload
1349-
def trace(func):
1350-
# type: (Callable[P, R]) -> Callable[P, R]
1350+
def trace(func=None, *, op=None, name=None, attributes=None):
1351+
# type: (None, Optional[str], Optional[str], Optional[dict[str, Any]]) -> Callable[[Callable[P, R]], Callable[P, R]]
1352+
# Handles: @trace() and @trace(op="custom")
13511353
pass
13521354

13531355

0 commit comments

Comments
 (0)