robust type handling in python makes this problem very easy