Skip to content

Commit af09df9

Browse files
authored
textwrap: various fixes (#3819)
1 parent 3c770a7 commit af09df9

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

stdlib/3/textwrap.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class TextWrapper:
2121
whitespace_trans: str = ...
2222
unicode_whitespace_trans: Dict[int, int] = ...
2323
uspace: int = ...
24-
x: int = ...
24+
x: str = ... # leaked loop variable
2525

2626
def __init__(
2727
self,
@@ -53,7 +53,7 @@ class TextWrapper:
5353

5454

5555
def wrap(
56-
text: str = ...,
56+
text: str,
5757
width: int = ...,
5858
*,
5959
initial_indent: str = ...,
@@ -109,5 +109,5 @@ def shorten(
109109
def dedent(text: str) -> str:
110110
...
111111

112-
def indent(text: str, prefix: str, predicate: Callable[[str], bool] = ...) -> str:
112+
def indent(text: str, prefix: str, predicate: Optional[Callable[[str], bool]] = ...) -> str:
113113
...

tests/stubtest_whitelists/py3_common.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,6 @@ tempfile.SpooledTemporaryFile.__next__
726726
tempfile.SpooledTemporaryFile.readable
727727
tempfile.SpooledTemporaryFile.seekable
728728
tempfile.SpooledTemporaryFile.writable
729-
textwrap.TextWrapper.x
730-
textwrap.indent
731-
textwrap.wrap
732729
threading.BoundedSemaphore.__enter__
733730
threading.BoundedSemaphore.acquire
734731
threading.Condition.acquire

0 commit comments

Comments
 (0)