Skip to content

Commit

Permalink
gh-113317: Remove TextAccumulator type alias from clinic.py (#113413)
Browse files Browse the repository at this point in the history
Clean-up after gh-113402.
  • Loading branch information
erlend-aasland authored Dec 22, 2023
1 parent d1c711e commit 9c3ddf3
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2342,9 +2342,6 @@ def write(self, text: str) -> None:
self.f.write(text)


TextAccumulator = list[str]


class BufferSeries:
"""
Behaves like a "defaultlist".
Expand All @@ -2358,13 +2355,13 @@ class BufferSeries:

def __init__(self) -> None:
self._start = 0
self._array: list[TextAccumulator] = []
self._array: list[list[str]] = []

def __getitem__(self, i: int) -> TextAccumulator:
def __getitem__(self, i: int) -> list[str]:
i -= self._start
if i < 0:
self._start += i
prefix: list[TextAccumulator] = [[] for x in range(-i)]
prefix: list[list[str]] = [[] for x in range(-i)]
self._array = prefix + self._array
i = 0
while i >= len(self._array):
Expand Down Expand Up @@ -2563,7 +2560,7 @@ def __init__(
'impl_definition': d('block'),
}

DestBufferType = dict[str, TextAccumulator]
DestBufferType = dict[str, list[str]]
DestBufferList = list[DestBufferType]

self.destination_buffers_stack: DestBufferList = []
Expand Down Expand Up @@ -2635,7 +2632,7 @@ def get_destination_buffer(
self,
name: str,
item: int = 0
) -> TextAccumulator:
) -> list[str]:
d = self.get_destination(name)
return d.buffers[item]

Expand Down

0 comments on commit 9c3ddf3

Please sign in to comment.