Skip to content

Fast container literal cache should not be used in loops #20866

Description

@ilevkivskyi

Fast container literal cache can cause correctness issues with loops like this one:

while foo():
    x = [x]

Instead fixing it (again), I propose to simply delete it, since we now have general expression cache that works well with binder and partial types.

This can affect both regular mode and --allow-redefinition-new, but mostly the latter.

cc @JukkaL

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-inferenceWhen to infer types or require explicit annotations

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions