def _lookup(self, expression: str, temp_locals: dict[str, Any]) -> object:
        """
        Do lookup of `object_var` in the context.
        `temp_locals` is a dictionary, used for the locals.
        """
        try:
            return eval(expression.strip(), self.get_globals(), temp_locals)
        except BaseException:
            return None  # Many exception, like NameError can be thrown here.

        Do lookup of `object_var` in the context.
        `temp_locals` is a dictionary, used for the locals.
        
src/ptpython/completer.py