Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all type: ignore #87

Closed
EliasJRH opened this issue Mar 16, 2024 · 5 comments
Closed

Remove all type: ignore #87

EliasJRH opened this issue Mar 16, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@EliasJRH
Copy link
Contributor

There are a lot of instances of # type: ignore in the codebase. While they don't need to get removed, it might be a good idea to look into why they're there and get rid of them.

@EliasJRH EliasJRH added the enhancement New feature or request label Mar 16, 2024
@linguini1
Copy link
Collaborator

These are for the Pyright linting and they're important to be there for situations where Pyright can't infer types itself.

@EliasJRH
Copy link
Contributor Author

These are for the Pyright linting and they're important to be there for situations where Pyright can't infer types itself.

I understand, but there are a few instances of these that arise because we are avoiding fixing the types when they could be fixed. For example, in telemetry.py, the self.replay_input field has # type: ignore because we are casting a multiprocessing queue to a regular python queue. I believe these can be fixed

@linguini1
Copy link
Collaborator

These are for the Pyright linting and they're important to be there for situations where Pyright can't infer types itself.

I understand, but there are a few instances of these that arise because we are avoiding fixing the types when they could be fixed. For example, in telemetry.py, the self.replay_input field has # type: ignore because we are casting a multiprocessing queue to a regular python queue. I believe these can be fixed

There's actually a really long issue for this where basically multiprocessing queues cannot be used as type annotations, only regular queues. So using the regular queues actually allow proper type hinting. Unfortunately it doesn't work flawlessly when constructing the new queues because Pyright still can't infer, hence the comments.

I lost way too many hours on this: python/cpython#99509

If there's something else I'm not understanding about the comments please lmk but I'm keeping this issue closed for now as the # type: ignore comments that remain are specifically there for a reason

@EliasJRH
Copy link
Contributor Author

Big L, Understood

@linguini1
Copy link
Collaborator

Yeah pretty much sucks. If you are experimenting with them though and find some you can remove, just lmk and I'll reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants