Skip to content

PythonCall - Not all in-scope variables available with callback #312

Closed
@bryaan

Description

@bryaan

Affects: PythonCall

I don't have the ability to post the exact code that causes this to break. However it is a very strange issue that seems to be due to this library. I am using julia 1.9.0.

In the following code for some reason not all variables will be available in the callback. Changing the order of declaration doesn't seem to affect it. Nor does making the variable a global. The issue happens consistently and I'm not sure what can be done to debug.

pylib = pyimport("mypylib")

a, b = create()
x = Dates.Second(15)
nextGuiUpdateDateTime = 1
c = 5

function callback(p1, p2)
    @show a, x, c
    @show nextGuiUpdateDateTime # doesnt work
end
pylib.start_loop(callback)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions