News for hackers. Stuff that matters.
Re:Applying Mypy to real-world projects by mikeholler on Tuesday February 11, 2020 @04:29PM (#22303082)
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.

Re:Applying Mypy to real-world projects by eire1130 on Tuesday February 11, 2020 @05:23PM (#22303601)
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.
Re:Applying Mypy to real-world projects by StavrosK on Tuesday February 11, 2020 @05:10PM (#22303471)
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.