[issue29630] REPL tab-completion triggers code execution

Francisco Demartino report at bugs.python.org
Thu Feb 23 04:52:54 EST 2017


Francisco Demartino added the comment:

> There is no way to safely inspect any Python object without triggering some dunder functions like __getattr__, __getattribute__ or __dir__.

But somehow inspect.getattr_static can do it?

> Your change is not backwards compatible and makes auto-completion less useful.

Why is it less useful? The only change is not executing property getters when showing completion options. It's removing a surprising code execution before the newline is received.

Should CPython keep backwards compatibility of this execution-on-completion at the REPL?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29630>
_______________________________________


More information about the Python-bugs-list mailing list