CLN: use numbers module for type checking in is_* methods