Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Apply suggestions from code review
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
erlend-aasland and AlexWaygood authored Jul 16, 2023
commit 03f8031cf37ca1e2dc8f5448bf5b1736950521ab
7 changes: 3 additions & 4 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,9 @@ class FormatCounterFormatter(string.Formatter):
{'a': 2, 'b': 1, 'c': 1}
"""
def __init__(self) -> None:
self.counts: dict[str, int] = collections.Counter()
self.counts = collections.Counter[str]()

def get_value(self, key: str | int, args, kwargs) -> str:
assert isinstance(key, str)
def get_value(self, key: str, args, kwargs) -> str: # type: ignore[override]
self.counts[key] += 1
return ''

Expand Down Expand Up @@ -759,7 +758,7 @@ class CLanguage(Language):
def __init__(self, filename: str) -> None:
super().__init__(filename)
self.cpp = cpp.Monitor(filename)
setattr(self.cpp, "fail", fail)
self.cpp.fail = fail # type: ignore[method-assign]

def parse_line(self, line: str) -> None:
self.cpp.writeline(line)
Expand Down