summaryrefslogtreecommitdiffstats
path: root/Lib/rlcompleter.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/rlcompleter.py')
-rw-r--r--Lib/rlcompleter.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py
index c06388e..34b2599 100644
--- a/Lib/rlcompleter.py
+++ b/Lib/rlcompleter.py
@@ -176,6 +176,16 @@ class Completer:
if (word[:n] == attr and
not (noprefix and word[:n+1] == noprefix)):
match = "%s.%s" % (expr, word)
+ if isinstance(getattr(type(thisobject), word, None),
+ property):
+ # bpo-44752: thisobject.word is a method decorated by
+ # `@property`. What follows applies a postfix if
+ # thisobject.word is callable, but know we know that
+ # this is not callable (because it is a property).
+ # Also, getattr(thisobject, word) will evaluate the
+ # property method, which is not desirable.
+ matches.append(match)
+ continue
try:
val = getattr(thisobject, word)
except Exception: