Skip to content

Inconsistency between unbound and undeclared symbols #229

@sharkdp

Description

@sharkdp

Pretty much what @carljm wrote in a comment here, and what is now described in this TODO comment:

https://github.com/astral-sh/ruff/blob/13a1483f1e51087d7c95922a6b3d2914ac2b68c3/crates/red_knot_python_semantic/src/types.rs#L80-L93

I'm opening this as a ticket as there seems to be an open discussion point regarding the desired behavior:

Possibly the behavior here should differ depending on whether we are importing from a stub or a regular Python module? But an argument could be made that even in a regular Python module, if it declares x: int at module level, we should just trust that and not require that we can see the binding of it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions