We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 474f950 commit 5046882Copy full SHA for 5046882
circuitpython_typing/__init__.py
@@ -15,9 +15,12 @@
15
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_Typing.git"
16
17
import array
18
-from typing import Optional, Union
+from typing import TYPE_CHECKING, Optional, Union
19
20
-try:
+# Protocol was introduced in Python 3.8, TypeAlias in 3.10
21
+from typing_extensions import Protocol, TypeAlias
22
+
23
+if TYPE_CHECKING:
24
import alarm
25
import audiocore
26
import audiomixer
@@ -28,11 +31,7 @@
28
31
from alarm.pin import PinAlarm
29
32
from alarm.time import TimeAlarm
30
33
from ulab.numpy import ndarray
-except ImportError:
- pass
34
-# Protocol was introduced in Python 3.8, TypeAlias in 3.10
35
-from typing_extensions import Protocol, TypeAlias
36
37
# Lists below are alphabetized.
38
0 commit comments