Skip to content

Commit 6a6b6d2

Browse files
authored
Merge pull request #31 from python-accelerator-middle-layer/typing
Fixed so importing from typing_extensions for earlier python versions.
2 parents 45d94d2 + abb7aae commit 6a6b6d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pyaml/magnet/magnet.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
from ..control import abstract
55
from .model import MagnetModel
66
from scipy.constants import speed_of_light
7-
from typing import Self
7+
try:
8+
from typing import Self # Python 3.11+
9+
except ImportError:
10+
from typing_extensions import Self # Python 3.10 and earlier
811
import numpy as np
912

1013
class MagnetConfigModel(ElementConfigModel):

0 commit comments

Comments
 (0)