Skip to content

Commit 6d71955

Browse files
committed
use Any with a comment instead of TextIO
1 parent 1ac283f commit 6d71955

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

stubs/Pygments/pygments/util.pyi

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import re
22
from collections.abc import Callable, Iterable, Sequence
33
from io import TextIOWrapper
4-
from typing import Any, TextIO, TypeVar
4+
from typing import Any, TypeVar
55

66
split_path_re: re.Pattern[str]
77
doctype_lookup_re: re.Pattern[str]
@@ -34,8 +34,11 @@ class Future:
3434
def get(self) -> str: ...
3535

3636
def guess_decode(text: bytes) -> tuple[bytes, str]: ...
37-
def guess_decode_from_terminal(text: bytes, term: TextIO | Any) -> tuple[bytes, str]: ...
38-
def terminal_encoding(term: TextIO | Any) -> str: ...
37+
38+
# In the following two methods, `term` are file-like objects that optionally have an
39+
# `encoding` attribute.
40+
def guess_decode_from_terminal(text: bytes, term: Any) -> tuple[bytes, str]: ...
41+
def terminal_encoding(term: Any) -> str: ...
3942

4043
class UnclosingTextIOWrapper(TextIOWrapper):
4144
def close(self) -> None: ...

0 commit comments

Comments
 (0)