Using KeysView
/ValuesView
/ItemsView
across sub modules can result in "can't find/import" error
#190
Labels
KeysView
/ValuesView
/ItemsView
across sub modules can result in "can't find/import" error
#190
Consider the following example:
The pattern here is:
KeyA
andKeyB
, one defined in sub-modulemodule_a
the other inmodule_b
.module_a
defines a mapdict[KeyA, int]
in line (1)module_b
defines two maps,dict[KeyA, bool]
anddict[KeyB, bool]
.Trying to generate stubs for the module fails with:
The issue seems to be triggered by the co-existence of lines (1) and (2), i.e., if
KeysA
gets used inmodule_a
in a map, it somehow "moves theKeysView[...]
type over" into that module. By commenting out line (1), theKeysView
ends up in the other sub-module which works. Conversely, commenting out line (2) also works, because thenmodule_b
is not trying to reference the invalidKeysView
path.For comparison, when commenting out line (1) the symbols in submodule a/b are divided as (trimmed outputs of
dir(my_native_module.module_X)
):Note that all the
KeysView
are local to b. Commenting in line (1) "moves" theKeysView
intomodule_a
leading to the problematic module path:The text was updated successfully, but these errors were encountered: