def _maybe_cast_indexer(self, key):
if is_float(key) and not self.is_floating():<EOL><INDENT>try:<EOL><INDENT>ckey = int(key)<EOL>if ckey == key:<EOL><INDENT>key = ckey<EOL><DEDENT><DEDENT>except (OverflowError, ValueError, TypeError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return key<EOL>
If we have a float key and are not a floating index, then try to cast
to an int if equivalent.