From d14058f12307f036021b8f33385e2d65a9057787 2023-04-22 17:33:23 From: Carlos Cordoba Date: 2023-04-22 17:33:23 Subject: [PATCH] Allow safe access to the __getattribute__ method of modules This restores code completions of second-level modules when Jedi completions are disabled. --- diff --git a/IPython/core/guarded_eval.py b/IPython/core/guarded_eval.py index 3c95213..1eca14d 100644 --- a/IPython/core/guarded_eval.py +++ b/IPython/core/guarded_eval.py @@ -637,6 +637,7 @@ set_non_mutating_methods = set(dir(set)) & set(dir(frozenset)) dict_keys: Type[collections.abc.KeysView] = type({}.keys()) method_descriptor: Any = type(list.copy) +module = type(builtins) NUMERICS = {int, float, complex} @@ -686,6 +687,7 @@ BUILTIN_GETATTR: Set[MayHaveGetattr] = { *NUMERICS, dict_keys, method_descriptor, + module, }