3 ms·
This is a good read. I did not know about typing.cast and was just putting # type: ignore on things. So far, we've had a pretty positive experience with mypy a
by mikeholler 7y ago
This is a good read. I did not know about typing.cast and was just putting # type: ignore on things.
So far, we've had a pretty positive experience with mypy and it's helped prevent a few bugs. Do be prepared to find weird edges you can cut yourself on along the way, but all-in-all I think it's a positive value add.
- StavrosK 7y agoSame here, this article is worth it for cast alone. I also have the same experience as you, it's sometimes wrong but nothing an ignore won't fix, and the bugs it's found have saved me lots of time.
- eire1130 7y agoI would advise to be cautious with cast. It can be powerful and mask bugs if you arent careful (ie, type checker said it's ok, so it must be ok!). You may also want to drop a comment if you use it.