5 ms·
The thing I find annoying with MyPt is trying to tell it I'm doing variable shadowing. E.g. X is a list of strings Translate X to a list of indices Translate X
by mabster 1y ago
The thing I find annoying with MyPt is trying to tell it I'm doing variable shadowing.
E.g. X is a list of strings
Translate X to a list of indices
Translate X back to a list of strings.
In that paragraph the input and output types are the same, but not complains about the second line.
I always have to introduce a variable with a new name.
- bormaj 1y agoYeah I see what you mean, you can always disable specific features, but I think that's a habit mypy tries to enforce. They consider redefining a variable bad practice. Even in rust you have to be explicit about doing the same thing with an extra "let" statement.
- mabster 1y agoYeah that's fair enough, and I've lived with it because of how good MyPy is. But I always end with weird variable names like uuids_as_list as a result!