Hacker News new | ask | show | jobs
by mikeholler 2319 days 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.

2 comments

I 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.
Same 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.