Keep Your Types in Check

Abhijit Gupta
The Startup
Published in
4 min readSep 9, 2020

You are not alone if you often get frustrated by “duck typing” in Python. By duck typing I mean if something walks like a duck and quacks like a duck, then, for sure, it is a duck! The apparent laxity in Python type system or its absence thereof is a potential source of huge number of bugs that pop up in the production time. Well, teams routinely employ robust “testing” to catch them but it’s usually never enough. Without strict type checking at compile time, more often than not bugs get caught only at the run time, which is ultimately not desirable. There are several ways to obviate this problem, and I am going…