Don't reify on REPL completion

This commit is contained in:
Pablo Galindo Salgado 2025-10-26 00:11:30 +01:00
parent c075f5b4fd
commit 59110fcfcc

View file

@ -36,6 +36,7 @@
import re
import __main__
import warnings
import types
__all__ = ["Completer"]
@ -188,7 +189,16 @@ def attr_matches(self, text):
# property method, which is not desirable.
matches.append(match)
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))
else:
matches.append(match)