Python - Polymorphism and Dynamic Behavior
Identify the bug in this polymorphic function:
def combine(a, b):
if isinstance(a, list) and isinstance(b, list):
return a + b
elif isinstance(a, dict) and isinstance(b, dict):
return {**a, **b}
else:
return a.append(b)