Space in f-string leads to ValueError: Invalid format specifier
Advertisements A colleague and I just stumbled across an interesting problem using an f-string. Here is a minimal example: >>> f"{ 42:x}" ‘2a’ Writing a space after the hexadecimal type leads to a ValueError: >>> f"{ 42:x }" Traceback (most recent call last): File "<stdin>", line 1, in <module> ValueError: Invalid format specifier I understand… Read More Space in f-string leads to ValueError: Invalid format specifier