While it may eventually be useful to mark the exceptions that can be
raised from a function or method, the semantics are currently undefined
and unclear.
I realized while working on srittau/type-stub-pep#64 that a
few things we do in existing enum definitions in typeshed are
problematic:
- Using "= ..." doesn't allow type checkers to correctly type the
result of Enum.MEMBER.value. In fact, mypy at least infers
.value to be "Ellipsis" if you do this.
- Properties on the enum values themselves, like HTTPStatus.phrase,
should not be specified directly as attributes, because it makes
type checkers think that the properties themselves are enum
members.
I ended up doing a bit more cleanup to the signal module:
- Remove unnecessary ... initializers.
- Remove unnecessary _SIG = Signals alias.
- I don't have Windows to test, but the C code for _signal suggests
that CTRL_C_EVENT and CTRL_BREAK events are not Signals, but just ints:
1dbd084f1f/Modules/signalmodule.c (L1575)