use to_int to integer duck-type check