Python - Polymorphism and Dynamic Behavior
You want to write a function
process(item) that works with any object having a serialize() method. Which approach best uses duck typing to handle objects without serialize() safely?