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.
2 parents a607dc0 + fbc73e5 commit 0fd2426Copy full SHA for 0fd2426
allensdk/core/typing.py
@@ -1,8 +1,15 @@
1
-from typing import _Protocol
+import sys
2
+try:
3
+ # for Python 3.8 and greater
4
+ from typing import Protocol
5
+except ImportError:
6
+ # for Python 3.7 and before
7
+ from typing import _Protocol as Protocol
8
+
9
from abc import abstractmethod
10
11
-class SupportsStr(_Protocol):
12
+class SupportsStr(Protocol):
13
"""Classes that support the __str__ method"""
14
@abstractmethod
15
def __str__(self) -> str:
0 commit comments