def _can_hold_identifiers_and_holds_name(self, name):
if self.is_object() or self.is_categorical():<EOL><INDENT>return name in self<EOL><DEDENT>return False<EOL>
Faster check for ``name in self`` when we know `name` is a Python
identifier (e.g. in NDFrame.__getattr__, which hits this to support
. key lookup). For indexes that can't hold identifiers (everything
but object & categorical) we just return False.

https://github.com/pandas-dev/pandas/issues/19764