Do not repr results if they contain hypens (eg. negative numbers)

This commit is contained in:
akp 2023-12-13 00:59:07 +00:00
parent 7384395c35
commit 58557e0496
No known key found for this signature in database
GPG key ID: CF8D58F3DEB20755

2
aoc
View file

@ -81,7 +81,7 @@ def run_command(args: list[str], stdin=None) -> tuple[int, str]:
def format_result(v: str) -> str:
if len(v) == len("".join(filter(lambda x: x.isalpha() or x.isdigit(), v))):
if len(v) == len("".join(filter(lambda x: x.isalpha() or x.isdigit() or x == "-", v))):
return v
return repr(v)