JuliaPy / PyCall.jl

Package to call Python functions from the Julia language
MIT License
1.46k stars 187 forks source link

Julia variable assignment in `@pywith` #957

Open jowch opened 2 years ago

jowch commented 2 years ago

Is it (or should it) be possible to assign values to Julia variables within an @pywith block? For example,

julia> @pywith pybuiltin("open")("Manifest.toml", "r") as f begin
           manifest = f.readlines()
       end

julia> manifest
ERROR: UndefVarError: manifest not defined

Thanks!