mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-04-25 00:13:00 +08:00
d05a9d3d83
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: https://github.com/python/cpython/blob/1dbd084f1f68d7293718b663df675cfbd0c65712/Modules/signalmodule.c#L1575