[issue44752] Tab completion executes @property getter function

Ryan Pecor report at bugs.python.org
Tue Jul 27 19:58:43 EDT 2021


Ryan Pecor <ryan at pecor.com> added the comment:

Actually, hasattr() specifically states that it uses getattr() so that behavior is expected from getattr() so I will not be creating a separate issue for that.

Now that I see hasattr() uses getattr(), it looks like the tab completion issue might not stem from line 155, but from line 180 (https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/rlcompleter.py#L180) where it calls getattr().

A possible fix to the tab completion issue might be to add to/expand the warning about evaluating arbitrary C code (https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/rlcompleter.py#L145) when using tab to autocomplete.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44752>
_______________________________________


More information about the Python-bugs-list mailing list