Skip to content

Commit bd0cc49

Browse files
committed
fix: use typing_extensions for override decorator for Python 3.10 compatibility
The override decorator was added in Python 3.12. For compatibility with Python 3.10, we import it from typing_extensions when not available in the typing module.
1 parent 56bad76 commit bd0cc49

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/a2a/server/models.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
from typing import Any, Generic, TypeVar, override
1+
from typing import TYPE_CHECKING, Any, Generic, TypeVar
2+
3+
4+
if TYPE_CHECKING:
5+
from typing_extensions import override
6+
else:
7+
8+
def override(func): # noqa: D103
9+
return func
10+
211

312
from pydantic import BaseModel
413

0 commit comments

Comments
 (0)