mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Don't reify on REPL completion
This commit is contained in:
parent
c075f5b4fd
commit
59110fcfcc
1 changed files with 11 additions and 1 deletions
|
|
@ -36,6 +36,7 @@
|
||||||
import re
|
import re
|
||||||
import __main__
|
import __main__
|
||||||
import warnings
|
import warnings
|
||||||
|
import types
|
||||||
|
|
||||||
__all__ = ["Completer"]
|
__all__ = ["Completer"]
|
||||||
|
|
||||||
|
|
@ -188,7 +189,16 @@ def attr_matches(self, text):
|
||||||
# property method, which is not desirable.
|
# property method, which is not desirable.
|
||||||
matches.append(match)
|
matches.append(match)
|
||||||
continue
|
continue
|
||||||
if (value := getattr(thisobject, word, None)) is not None:
|
|
||||||
|
if (isinstance(thisobject, types.ModuleType)
|
||||||
|
and
|
||||||
|
isinstance(thisobject.__dict__.get(word),types.LazyImportType)
|
||||||
|
):
|
||||||
|
value = thisobject.__dict__.get(word)
|
||||||
|
else:
|
||||||
|
value = getattr(thisobject, word, None)
|
||||||
|
|
||||||
|
if value is not None:
|
||||||
matches.append(self._callable_postfix(value, match))
|
matches.append(self._callable_postfix(value, match))
|
||||||
else:
|
else:
|
||||||
matches.append(match)
|
matches.append(match)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue