diff --git a/prompt_toolkit/contrib/regular_languages/compiler.py b/prompt_toolkit/contrib/regular_languages/compiler.py index 9d23490f1..a6eb77127 100644 --- a/prompt_toolkit/contrib/regular_languages/compiler.py +++ b/prompt_toolkit/contrib/regular_languages/compiler.py @@ -41,7 +41,7 @@ import re from typing import Callable, Dict, Iterable, Iterator, List from typing import Match as RegexMatch -from typing import Optional, Pattern, Tuple, cast +from typing import Optional, Pattern, Tuple from .regex_parser import ( AnyNode, diff --git a/prompt_toolkit/cursor_shapes.py b/prompt_toolkit/cursor_shapes.py index 42e3d5d80..d38b3505b 100644 --- a/prompt_toolkit/cursor_shapes.py +++ b/prompt_toolkit/cursor_shapes.py @@ -13,6 +13,8 @@ "CursorShapeConfig", "SimpleCursorShapeConfig", "ModalCursorShapeConfig", + "DynamicCursorShapeConfig", + "to_cursor_shape_config", ] diff --git a/prompt_toolkit/eventloop/async_context_manager.py b/prompt_toolkit/eventloop/async_context_manager.py index 173751ab0..39146165a 100644 --- a/prompt_toolkit/eventloop/async_context_manager.py +++ b/prompt_toolkit/eventloop/async_context_manager.py @@ -6,7 +6,7 @@ # mypy: allow-untyped-defs import abc from functools import wraps -from typing import TYPE_CHECKING, AsyncContextManager, AsyncIterator, Callable, TypeVar +from typing import AsyncContextManager, AsyncIterator, Callable, TypeVar import _collections_abc diff --git a/prompt_toolkit/eventloop/inputhook.py b/prompt_toolkit/eventloop/inputhook.py index 7490d5b25..26228a2af 100644 --- a/prompt_toolkit/eventloop/inputhook.py +++ b/prompt_toolkit/eventloop/inputhook.py @@ -29,16 +29,7 @@ import threading from asyncio import AbstractEventLoop from selectors import BaseSelector, SelectorKey -from typing import ( - TYPE_CHECKING, - Any, - Callable, - List, - Mapping, - NamedTuple, - Optional, - Tuple, -) +from typing import TYPE_CHECKING, Any, Callable, List, Mapping, Optional, Tuple from prompt_toolkit.utils import is_windows @@ -52,7 +43,7 @@ ] if TYPE_CHECKING: - from _typeshed import FileDescriptor, FileDescriptorLike + from _typeshed import FileDescriptorLike _EventMask = int diff --git a/prompt_toolkit/filters/base.py b/prompt_toolkit/filters/base.py index a268a82b1..fd57cca6e 100644 --- a/prompt_toolkit/filters/base.py +++ b/prompt_toolkit/filters/base.py @@ -1,5 +1,5 @@ from abc import ABCMeta, abstractmethod -from typing import Callable, Dict, Iterable, List, Tuple, Union, cast +from typing import Callable, Dict, Iterable, List, Tuple, Union __all__ = ["Filter", "Never", "Always", "Condition", "FilterOrBool"] diff --git a/prompt_toolkit/key_binding/bindings/vi.py b/prompt_toolkit/key_binding/bindings/vi.py index 89870ee53..efbb107de 100644 --- a/prompt_toolkit/key_binding/bindings/vi.py +++ b/prompt_toolkit/key_binding/bindings/vi.py @@ -3,7 +3,7 @@ import string from enum import Enum from itertools import accumulate -from typing import Callable, Iterable, List, Optional, Tuple, TypeVar, Union, cast +from typing import Callable, Iterable, List, Optional, Tuple, TypeVar, Union from prompt_toolkit.application.current import get_app from prompt_toolkit.buffer import Buffer, indent, reshape_text, unindent diff --git a/prompt_toolkit/output/vt100.py b/prompt_toolkit/output/vt100.py index 4c5e95165..058626728 100644 --- a/prompt_toolkit/output/vt100.py +++ b/prompt_toolkit/output/vt100.py @@ -6,24 +6,20 @@ everything has been highly optimized.) http://pygments.org/ """ -import array import io import os import sys from typing import ( - IO, Callable, Dict, Hashable, Iterable, - Iterator, List, Optional, Sequence, Set, TextIO, Tuple, - cast, ) from prompt_toolkit.cursor_shapes import CursorShape diff --git a/prompt_toolkit/output/win32.py b/prompt_toolkit/output/win32.py index cf446a437..abfd61774 100644 --- a/prompt_toolkit/output/win32.py +++ b/prompt_toolkit/output/win32.py @@ -1,14 +1,5 @@ import os -from ctypes import ( - ArgumentError, - byref, - c_char, - c_long, - c_short, - c_uint, - c_ulong, - pointer, -) +from ctypes import ArgumentError, byref, c_char, c_long, c_uint, c_ulong, pointer from ..utils import SPHINX_AUTODOC_RUNNING diff --git a/prompt_toolkit/shortcuts/progress_bar/base.py b/prompt_toolkit/shortcuts/progress_bar/base.py index 0f08dbfd0..c22507e25 100644 --- a/prompt_toolkit/shortcuts/progress_bar/base.py +++ b/prompt_toolkit/shortcuts/progress_bar/base.py @@ -51,7 +51,6 @@ from prompt_toolkit.layout.dimension import AnyDimension, D from prompt_toolkit.output import ColorDepth, Output from prompt_toolkit.styles import BaseStyle -from prompt_toolkit.utils import in_main_thread from .formatters import Formatter, create_default_formatters