I am trying to figure out how Literal from the typing module works. I tried the following example from PEP 586: from typing import Literal def accepts_only_four(x: Literal[4]) -> None: pass accepts_only_four(4) # OK accepts_only_four(19) # Rejected In my case nothing is rejected. I am running Python 3.11.5 on Windows 11. What am I doing wrong? Continue reading...