Detect redundant type conversion #11554
Replies: 2 comments
|
My guess this is not something Pyright would do. This is not really a type checking scenario, but more of a linting scenario. You're not doing anything that is wrong, just redundant. |
Rich Chiodo (@rchiodo) Thank you for your reply. I agree with the following points:
However, note that redundant conversions shift from "not wrong, just redundant" to becoming a performance bottleneck on a hot path when you need to work with data-heavy pipelines and thousands of users. I will close this discussion for now. UPDATE: I've found this is already implemented by Pyrefly: https://pyrefly.org/en/docs/error-kinds/#unnecessary-type-conversion |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Bad example 1
Bad example 2
Bad example 3
Open questions
All reactions