Use typing_extensions for SupportsIndex

Co-authored-by: ItsDrike <itsdrike@protonmail.com>
This commit is contained in:
Kevin Tindall
2022-01-26 10:59:35 -06:00
committed by Kevin Tindall
parent 6be73e995b
commit 2074009a8d
3 changed files with 6 additions and 10 deletions

View File

@@ -1,13 +1,8 @@
from abc import abstractmethod, ABC from abc import abstractmethod, ABC
from typing import SupportsBytes, Iterable, Tuple, Union
try: from typing_extensions import SupportsIndex # Python 3.7 doesn't support this yet.
from typing import SupportsBytes, Iterable, SupportsIndex, Tuple, Union
BytesConvertable = Union[SupportsIndex, Iterable[SupportsIndex]] BytesConvertable = Union[SupportsIndex, Iterable[SupportsIndex]]
except ImportError:
from typing import SupportsBytes, Iterable, Tuple, Union
BytesConvertable = Union[int, Iterable[int]]
import socket import socket
import struct import struct
import asyncio import asyncio

4
poetry.lock generated
View File

@@ -715,7 +715,7 @@ python-versions = ">=3.6"
name = "typing-extensions" name = "typing-extensions"
version = "4.0.1" version = "4.0.1"
description = "Backported and Experimental Type Hints for Python 3.6+" description = "Backported and Experimental Type Hints for Python 3.6+"
category = "dev" category = "main"
optional = false optional = false
python-versions = ">=3.6" python-versions = ">=3.6"
@@ -786,7 +786,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = ">=3.7" python-versions = ">=3.7"
content-hash = "9e819727883898bb2d4f2bd80e98f1488c66584232802e51325d534e15639edd" content-hash = "929f5970e749a6090ecd06bf16d1c2e52f6f5dad348d4472c1d5d92b6c9235c3"
[metadata.files] [metadata.files]
asyncio-dgram = [ asyncio-dgram = [

View File

@@ -33,6 +33,7 @@ python = ">=3.7"
asyncio-dgram = "1.2.0" asyncio-dgram = "1.2.0"
click = "7.1.2" click = "7.1.2"
dnspython = "2.1.0" dnspython = "2.1.0"
typing-extensions = "^4.0.1"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
coverage = "^6.1.1" coverage = "^6.1.1"