From 8b804d335a0526a9dc6d8f6b80e225fa1d4e785c Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com> Date: Thu, 21 Oct 2021 13:57:40 +0300 Subject: [PATCH] Import `Callable` from `typing` --- tomli/_parser.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tomli/_parser.py b/tomli/_parser.py index cac02af..53721af 100644 --- a/tomli/_parser.py +++ b/tomli/_parser.py @@ -1,9 +1,9 @@ from __future__ import annotations -from collections.abc import Callable, Iterable +from collections.abc import Iterable import string from types import MappingProxyType -from typing import Any, BinaryIO, NamedTuple, Tuple +from typing import Any, BinaryIO, Callable, NamedTuple, Tuple import warnings from tomli._re import ( @@ -46,9 +46,11 @@ ) # Type annotations +Pos = int +# Use `collections.abc.Callable` when min Python is 3.9 ParseFloat = Callable[[str], Any] +# use `tuple` when min Python is 3.9 Key = Tuple[str, ...] -Pos = int class TOMLDecodeError(ValueError):