ruff/crates/red_knot_python_semantic/resources/mdtest/import
Douglas Creager e8e461da6a
Prioritize attribute in from/import statement (#15041)
This tweaks the new semantics from #15026 a bit when a symbol could be
interpreted both as an attribute and a submodule of a package. For
`from...import`, we should actually prioritize the attribute, because of
how the statement itself is implemented [1].

> 1. check if the imported module has an attribute by that name
> 2. if not, attempt to import a submodule with that name and then check
the imported module again for that attribute

[1] https://docs.python.org/3/reference/simple_stmts.html#the-import-statement
2024-12-17 16:58:23 -05:00
..
basic.md [red-knot] Explicitly test diagnostics are emitted for unresolvable submodule imports (#15035) 2024-12-17 12:55:50 +00:00
builtins.md Sync vendored typeshed stubs (#14977) 2024-12-15 01:02:41 +00:00
conditional.md Improve mdtests style (#14884) 2024-12-10 13:05:51 +00:00
conflicts.md Prioritize attribute in from/import statement (#15041) 2024-12-17 16:58:23 -05:00
errors.md Migrate some inference tests to mdtests (#14795) 2024-12-06 11:19:22 +01:00
invalid_syntax.md Handle nested imports correctly in from ... import (#15026) 2024-12-17 14:23:34 -05:00
relative.md Handle nested imports correctly in from ... import (#15026) 2024-12-17 14:23:34 -05:00
stubs.md [red-knot] Autoformat mdtest Python snippets using blacken-docs (#13809) 2024-10-19 15:57:06 +01:00
tracking.md Bind top-most parent when importing nested module (#14946) 2024-12-16 16:15:40 -05:00