Jacob Walls
Jacob Walls
Thanks for the investigation @jonmcfee03. I had a look myself. I don't think `import_string()` is the issue. Its docstring says: > "Import a dotted module path and return the attribute/class...
> however, the question is why does import_string('model_fields.test_decimalfield') fail when the module exists but hasn't been loaded. `import_string()` is a bit of a misnomer. It chops off the rightmost term,...
> What are we gaining with your more complicated fix rather than letting import_string() do the work? Good point. Nothing is gained; just wanted to have a look at an...
I had a look at what else might break if we start changing `import_string()` to accept submodules, (or potentially top-level modules too, although this PR doesn't currently support that). Theoretically,...
Thanks for the report. I guess we could just skip this test if pip is not available.
Thanks, I didn't notice that ImportError is raised when nothing is found. Good point. However, I still think we should add the path to the cache key even when modules...
For example, the path is part of the cache key for modules here: https://github.com/pylint-dev/astroid/blob/7a3b482b9673243d2ccc895672eb1e452f5daa82/astroid/manager.py#L301-L305
About the dataclasses, did you consider doing something like this for simplicity? ```diff diff --git a/astroid/interpreter/_import/spec.py b/astroid/interpreter/_import/spec.py index c812a612..65d7c88d 100644 --- a/astroid/interpreter/_import/spec.py +++ b/astroid/interpreter/_import/spec.py @@ -16,7 +16,6 @@ import types...
> Am I missing something? Maybe a better way to cache the path? Otherwise it seems like it may be better to optimize somewhere else. I'm wondering if the issue...
The potential indeterminacy of the frozenset does scare me a little bit. Just this week on Discord someone was asking for pointers about debugging indeterminate behavior of the `cyclic-import` check,...