Skip to content

UndefVarError: y not defined for iteration in Python back to Julia #134

Closed
@femtomc

Description

@femtomc

I keep running into this UndefVarError issue when passing iterators from Julia back over to Python.

I think generally this most frequently occurs during list comprehensions.

ERROR: LoadError: Python: Julia: UndefVarError: y not defined
Stacktrace:
  [1] errset
    @ ~/.julia/packages/PythonCall/B5irB/src/err.jl:28 [inlined]
  [2] pyjliter_next(self::PythonCall.Iterator)
    @ PythonCall ~/.julia/packages/PythonCall/B5irB/src/jlwrap/iter.jl:19
  [3] _pyjl_callmethod(f::Any, self_::Ptr{PythonCall.C.PyObject}, args_::Ptr{PythonCall.C.PyObject}, nargs::Int64)
    @ PythonCall ~/.julia/packages/PythonCall/B5irB/src/jlwrap/base.jl:58
  [4] _pyjl_callmethod(o::Ptr{PythonCall.C.PyObject}, args::Ptr{PythonCall.C.PyObject})
    @ PythonCall.C ~/.julia/packages/PythonCall/B5irB/src/cpython/jlwrap.jl:47
  [5] PyObject_CallObject
    @ ~/.julia/packages/PythonCall/B5irB/src/cpython/pointers.jl:290 [inlined]
  [6] macro expansion
    @ ~/.julia/packages/PythonCall/B5irB/src/Py.jl:129 [inlined]
  [7] pycallargs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions