Skip to content
This repository was archived by the owner on Mar 20, 2021. It is now read-only.
This repository was archived by the owner on Mar 20, 2021. It is now read-only.

with block: frame.f_local is read-only #1

Description

@ep12

Describe the bug
Currently only global variables can be assigned new values. (status quo: see comments below)

To Reproduce

from pyopm.core import ObjectPattern
def myfunc():
    x = 5
    p = ObjectPattern({'obj': {'bind': {'x': None}}})
    m = p.match(dict())
    with m:
        print(x)

myfunc()

will print 5, because the locals cannot be updated (__enter__ -> _start_block).

Expected behavior
myfunc() should result in {} being printed.

Screenshots
None

Additional context
python 3.8.2

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

    help wantedExtra attention is neededmore tests neededA feature can only be considered stable if there are lots of different tests

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions