Browse Source
bpo-44752: refactor part of rlcompleter.Completer.attr_matches (GH-27433)
pull/27449/head
Jack DeVries
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
6 deletions
-
Lib/rlcompleter.py
|
|
|
@ -186,13 +186,10 @@ class Completer: |
|
|
|
# property method, which is not desirable. |
|
|
|
matches.append(match) |
|
|
|
continue |
|
|
|
try: |
|
|
|
val = getattr(thisobject, word) |
|
|
|
except Exception: |
|
|
|
pass # Include even if attribute not set |
|
|
|
if (value := getattr(thisobject, word, None)) is not None: |
|
|
|
matches.append(self._callable_postfix(value, match)) |
|
|
|
else: |
|
|
|
match = self._callable_postfix(val, match) |
|
|
|
matches.append(match) |
|
|
|
matches.append(match) |
|
|
|
if matches or not noprefix: |
|
|
|
break |
|
|
|
if noprefix == '_': |
|
|
|
|