Address type issues#1751
Conversation
|
Note to self: merge with #1720, check for conflicts and type errors. |
|
How would that work? |
|
I see that you are making some of the same improvements to types that I am; changing So I'm thinking we can somehow test your type changes against my improved pyright configuration, to see if they're compatible. Is that what you were asking? |
68919bc to
c9e9df6
Compare
eruvanos
left a comment
There was a problem hiding this comment.
I read through all files but in most gl parts I am unsure.
The changes for the GUI look good, especially if they work ;)
The | operator should not be used due to the Python 3.10 requirement.
|
@pvcraven maybe it is time to move to pyright. |
|
That's fine by me. I'd started a while back fixing some things, glad to see some other people working on it. |
|
Yes, we don't want to use the | operator yet. It is awesome, I agree, but we still need python 3.9 compatibility. |
|
Cool, we'll see if @eruvanos has a sec to double check, but I think his concerns were addressed. |
eruvanos
left a comment
There was a problem hiding this comment.
Thanks for the changes, from my point of view, all remaining changes (beside the asserts) look good.
Will merge as soon as they are replaced.
Again thank you for all your work!
|
I created pythonarcade/pytiled_parser#69 to track changes to type annotations in pytiled_parser which eliminate the need for |
Mypy is unable to typecheck against pyglet and other deps that don't include a
py.typedfile. So it's unable to catch certain issues within arcade's own codebase. Pyright has an option telling it to use the source code ofpygletas types. I couldn't find an equivalent option for mypy.Yeah, some of the diagnostics are mere nuisances, unlikely to cause real problems. But some are legit.
This PR tweaks the pyright configuration and also makes minor changes to code to address some of the diagnostics. I'm not sure the best way to solicit feedback, ideally the GUI changes would be reviewed by someone familiar with the GUI code, etc.
I haven't fixed all the issues, but I want to pause this work till I get the team's temperature re: making these changes & enabling pyright on CI. I don't want to impose unwelcome work on the team.