Repository navigation
Conversation
|
This is not a 'fix'. This is - at best - applying a new best practice which could change in the future. |
The typing spec is not a "best practice", it's the official definition of Python's type system, and every single type-checkers has it has their goal to conform to this typing spec.
The Python Typing Council (which I'm part of) takes extreme care not to introduce backwards incompatible changes in Python's official typing spec. In fact, it's the other way around: The current situation is that these stubs are relying on undefined behavior. It's surprising that this even works TBH. There's a good chance though that it only works with certain type-checkers like mypy. And since this behavior isn't (and won't be) specified in the typing spec, there's a good change that this will break in the future. As far as I can tell there's also no good reason to choose the current exotic (and very verbose) Anyway, of course it's your decision to make, but I think it's a mistake not to accept this. |
|
I think I'm going to apply these changes -- just split between multiple commits so it's easier to follow |
|
Much appreciated :) |
I noticed that the
EnumandFlagdeclarations in the.pyistubs weren't quite right. I changed them in a backwards compatible manner so that they now follow conform to the typing spec.I verified with stubtest (a mypy tool) that this doesn't result in new errors (it went down by 2 even because of the removed
__get__and__set__). I plan to take care of the remaining (265) stubtest errors as well (assuming you're open to it).