API refactor
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-07 16:25:52 +09:00
parent 76d0d86211
commit 91c7e04474
1171 changed files with 81940 additions and 44117 deletions

View File

@@ -15,7 +15,7 @@ from decimal import Decimal
from itertools import chain
from numbers import Number
from pprint import _recursion
from typing import Any, AnyStr, Callable, Dict, Iterator, List, Sequence, Set, Tuple # noqa
from typing import Any, AnyStr, Callable, Dict, Iterator, List, Optional, Sequence, Set, Tuple # noqa
from .text import truncate
@@ -41,7 +41,7 @@ _quoted = namedtuple('_quoted', ('value',))
#: Recursion protection.
_dirty = namedtuple('_dirty', ('objid',))
#: Types that are repsented as chars.
#: Types that are represented as chars.
chars_t = (bytes, str)
#: Types that are regarded as safe to call repr on.
@@ -194,9 +194,12 @@ def _reprseq(val, lit_start, lit_end, builtin_type, chainer):
)
def reprstream(stack, seen=None, maxlevels=3, level=0, isinstance=isinstance):
def reprstream(stack: deque,
seen: Optional[Set] = None,
maxlevels: int = 3,
level: int = 0,
isinstance: Callable = isinstance) -> Iterator[Any]:
"""Streaming repr, yielding tokens."""
# type: (deque, Set, int, int, Callable) -> Iterator[Any]
seen = seen or set()
append = stack.append
popleft = stack.popleft