This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user