Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not every function, but often enough that it gets annoying.

It mostly happens when dealing with very tight systems, e.g. a RabbitMQ queue consumer fetching messages from an external system and writing stuff to MySQL & Cassandra.

The general issue is that there are some kinds of data types (integer, string, datetime) that cannot really be duck-typed, i.e. replaced by different objects. In my experience, it is better to catch such type errors sooner rather than later, therefore isinstance() checks.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: