Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default parameter value from class scope not seen by jurigged on method reload #30

Open
karolinepauls opened this issue Dec 8, 2023 · 0 comments

Comments

@karolinepauls
Copy link

environment
image:docker.io/library/python:3.9.6
docker: Docker version 24.0.7, build afdd53b (native Linux, Kubuntu)
jurigged: 0.5.7

script.py:

import time

class A:
    CONST = 12

    def m(self, val=CONST):
        print(val)

a = A()
while True:
    a.m()
    time.sleep(1)

cmd: jurigged script.py, then try modifying the method.

output:

12
12
12
Traceback (most recent call last):
  File "/opt/venv/lib/python3.9/site-packages/jurigged/codetools.py", line 493, in _process_child_correspondence
    orig.apply_correspondence(
  File "/opt/venv/lib/python3.9/site-packages/jurigged/codetools.py", line 704, in apply_correspondence
    new_obj = self.reevaluate(corr.new.node, glb)
  File "/opt/venv/lib/python3.9/site-packages/jurigged/codetools.py", line 790, in reevaluate
    exec(code, glb, lcl)
  File "/app/script.py", line 7, in <adjust>
    def m(self, val=CONST):
NameError: name 'CONST' is not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant