Skip to content

Commit

Permalink
Add type annotations for _condense_affix()
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed May 21, 2022
1 parent 1e7fcae commit 3663272
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chess/pgn.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@
(?P<suffix>\s?)
""", re.VERBOSE)

def _condense_affix(infix: str):
def repl(match):
def _condense_affix(infix: str) -> Callable[[typing.Match[str]], str]:
def repl(match: typing.Match[str]) -> str:
if infix:
return match.group("prefix") + infix + match.group("suffix")
else:
Expand Down

0 comments on commit 3663272

Please sign in to comment.