Skip to content

Commit 9d9f304

Browse files
committed
[BUG] Ensure compatibility with older Python versions
Added a fallback import for `NotRequired` from `typing_extensions` to maintain compatibility with Python versions that lack native support for this typing feature.
1 parent 20ad605 commit 9d9f304

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

gempy/modules/json_io/schema.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
This module defines the expected structure of JSON files for loading and saving GemPy models.
44
"""
55

6-
from typing import TypedDict, List, Dict, Any, Optional, Union, Sequence, NotRequired
6+
from typing import TypedDict, List, Dict, Any, Optional, Union, Sequence
7+
8+
try:
9+
from typing import NotRequired
10+
except ImportError:
11+
from typing_extensions import NotRequired # Fallback for older Python versions
12+
713

814
class SurfacePoint(TypedDict):
915
x: float

0 commit comments

Comments
 (0)