Skip to content

Commit 9ed7be3

Browse files
fix(typing): fallback to typing_extensions when importing Self
References #17
1 parent 7cbf31a commit 9ed7be3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

circuitpython_mocks/_mixins.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
from collections import deque
2-
from typing import Self, Deque, Union, TYPE_CHECKING
2+
from typing import Deque, Union, TYPE_CHECKING
3+
4+
try:
5+
from typing import Self
6+
except ImportError:
7+
from typing_extensions import Self
8+
39

410
if TYPE_CHECKING:
511
from circuitpython_mocks.busio.operations import (

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
adafruit-circuitpython-typing
22
pytest
3+
typing-extensions~=4.0

0 commit comments

Comments
 (0)