Skip to content
This repository was archived by the owner on Nov 23, 2024. It is now read-only.
This repository was archived by the owner on Nov 23, 2024. It is now read-only.

Missing NonLocalVariableRead from dictionary access #301

@lukarade

Description

@lukarade

Describe the bug

The NonLocalVariableRead caused by accessing the instance variable self._dict in the following function was not detected.

# matplotlib.spines.__getattr__.551.4
def __getattr__(self, name):
    try:
        return self._dict[name] # Impure NonLocalVariableRead
    except KeyError:
        raise AttributeError(f"'Spines' object does not contain a '{name}' spine")

To Reproduce

  1. Run purity analysis on the matplotlib library
  2. Check the result file for the function: matplotlib.spines.getattr.551.4

Expected behavior

This should be detected even though it is access of the dictionary.

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't workingpurityInferring the purity of functions

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions