Skip to content

Commit bed5f46

Browse files
committed
Merge branch 'master' into feat/vendor-wcwidth
2 parents 5dbafee + 429883e commit bed5f46

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

pyte/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@
2525
__all__ = ("Screen", "DiffScreen", "HistoryScreen", "DebugScreen",
2626
"Stream", "ByteStream")
2727

28-
import io
29-
from typing import Union
30-
3128
from .screens import Screen, DiffScreen, HistoryScreen, DebugScreen
3229
from .streams import Stream, ByteStream
3330

3431

3532
if __debug__:
33+
import io
34+
3635
def dis(chars: bytes | str) -> None:
3736
"""A :func:`dis.dis` for terminals.
3837

pyte/screens.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
import warnings
3636
from collections import deque, defaultdict
3737
from functools import lru_cache
38-
from typing import Any, Dict, List, NamedTuple, Optional, Set, TextIO, TypeVar
39-
from collections.abc import Callable, Generator, Sequence
38+
from typing import TYPE_CHECKING, NamedTuple, TypeVar
4039

4140
from . import (
4241
charsets as cs,
@@ -47,6 +46,9 @@
4746
from .streams import Stream
4847
from .wcwidth import wcwidth
4948

49+
if TYPE_CHECKING:
50+
from collections.abc import Callable, Generator, Sequence
51+
from typing import Any, NamedTuple, TextIO
5052

5153
KT = TypeVar("KT")
5254
VT = TypeVar("VT")

pyte/streams.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
import re
2626
import warnings
2727
from collections import defaultdict
28-
from collections.abc import Mapping
29-
from typing import Any, Dict, Optional, TYPE_CHECKING
30-
from collections.abc import Callable, Generator
28+
from typing import TYPE_CHECKING
3129

3230
from . import control as ctrl, escape as esc
3331

3432
if TYPE_CHECKING:
33+
from collections.abc import Callable, Generator, Mapping
34+
from typing import Any
3535
from .screens import Screen
3636

37+
ParserGenerator = Generator[bool | None, str, None]
3738

38-
ParserGenerator = Generator[Optional[bool], str, None]
3939

4040
class Stream:
4141
"""A stream is a state machine that parses a stream of bytes and

0 commit comments

Comments
 (0)