Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#4353](https://github.com/open-telemetry/opentelemetry-python/pull/4353))
- sdk: don't log or print warnings when the SDK has been disabled
([#4371](https://github.com/open-telemetry/opentelemetry-python/pull/4371))
- Fix span context manager typing by using ParamSpec from typing_extensions
([#4389](https://github.com/open-telemetry/opentelemetry-python/pull/4389))

## Version 1.29.0/0.50b0 (2024-12-11)

Expand Down
14 changes: 8 additions & 6 deletions opentelemetry-api/src/opentelemetry/util/_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@
import asyncio
import contextlib
import functools
import typing
from typing import Callable, Generic, Iterator, TypeVar
from typing import TYPE_CHECKING, Callable, Generic, Iterator, TypeVar

V = TypeVar("V")
R = TypeVar("R") # Return type
Pargs = TypeVar("Pargs") # Generic type for arguments
Pkwargs = TypeVar("Pkwargs") # Generic type for arguments

if hasattr(typing, "ParamSpec"):
# only available in python 3.10+
# https://peps.python.org/pep-0612/
P = typing.ParamSpec("P") # Generic type for all arguments
# We don't actually depend on typing_extensions but we can use it in CI with this conditional
# import. ParamSpec can be imported directly from typing after python 3.9 is dropped
# https://peps.python.org/pep-0612/.
if TYPE_CHECKING:
from typing_extensions import ParamSpec

P = ParamSpec("P") # Generic type for all arguments


class _AgnosticContextManager(
Expand Down
Loading