Open
Description
This code:
import signal
signals = []
if hasattr(signal, 'SIGALRM'):
signals.append(signal.SIGALRM)
if hasattr(signal, 'SIGUSR1'):
signals.append(signal.SIGUSR1)
Produces:
ex.py:7: error: Argument 1 to "append" of "list" has incompatible type "Literal[Signals.SIGUSR1]"; expected "Literal[Signals.SIGALRM]" [arg-type]
Source: https://github.com/python/typeshed/blob/main/stdlib/signal.pyi
SIGALRM: Signals
SIGUSR1: Signals
It is a regression of 1.15.0, before this code was correct: https://mypy-play.net/?mypy=1.14.1&python=3.12&gist=24f0696ba047856ad7d932f4a7f25ec4
I don't see a reason, why two enum membres cannot be appended to a single list.