Could you coerce it to integer instead? Integers share the same object_id, but float doesn't.