Skip to content

Commit e14fdf0

Browse files
committed
fix: optional type var for Reference with python 3.13+
1 parent ef3e523 commit e14fdf0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scim2_models/reference.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from collections import UserString
23
from typing import Any
34
from typing import Generic
@@ -11,7 +12,11 @@
1112

1213
from .utils import UNION_TYPES
1314

14-
ReferenceTypes = TypeVar("ReferenceTypes")
15+
# TypeVar with default parameter is available in Python 3.13+
16+
if sys.version_info >= (3, 13):
17+
ReferenceTypes = TypeVar("ReferenceTypes", default=Any)
18+
else: # pragma: no cover
19+
ReferenceTypes = TypeVar("ReferenceTypes")
1520

1621
URIReference = NewType("URIReference", str)
1722
ExternalReference = NewType("ExternalReference", str)

0 commit comments

Comments
 (0)