The following works:
while True:
for event in pygame.event.get():
match (event.type):
case pygame.QUIT:
pygame.quit()
but if I write without "pygame." in the case expression
while True:
for event in pygame.event.get():
match (event.type):
case QUIT:
pygame.quit()
the case catches all the events and not only the QUIT one. Other potential cases are also marked unreachable by python.
Why is that? print(pygame.QUIT)
and print(QUIT)
both display "256".