Open toby-bro opened 1 month ago
For now all I can suggest is that you use pyright because its more feature complete and reflects the state of the language far more
I made a fixed version of the file but fixed it without properly understanding why we do different things between type checking time and execution time. https://github.com/toby-bro/python-betterproto/commit/87f46fe570fb8f976a61bc50458ff08cd8ecc95c As you also did a type checking PR was wondering if it could interest you. I can open a PR on your PR if you want (with the newest version of the file of course). This solves my problems (as I can't pass from mypy to pyright :sweat_smile: )
Summary
When using an enum in a code project mypy is broken and has the impression that all the enum fields are of type 'int'
Reproduction Steps
Run type checking on this file and see the problem in version 2.0.0b7
Expected Results
I would have expected the type checking to pass as in version 2.0.0-beta6
This is caused by #293 (and is not solved by #540)
The expected type of
Colour.RED
is aColour
not anint
.Actual Results
System Information
Checklist
pip install -U --pre betterproto
, if possible.