Skip to content

Inference of JoinedStr is inconsistent #2621

@ericvergnaud

Description

@ericvergnaud

Inference of JoinedStr is inconsistent. For example:

f"{unknown}" raises an InferenceError if unknown is not declared
f"{unknown}" returns Uninferable (the instance) if unknown is declared
f"a/{unknown}/b" raises an InferenceError if unknown is not declared
f"a/{unknown}/b" returns "a/Uninferable/b" if unknown is declared

This pushes to the user a lot of unwanted responsibility

Additionally, there are usage scenarios where the user would rather have a composite string (such as the latter case above) than the Uninferable instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions