```julia julia> using PyCall julia> obj = pyimport("sys") # get some PyObject PyObject <module 'sys' (built-in)> julia> py""" ns = {} def set(name): ns[name] = $include_string($Main, name) """ julia> py"set"("obj") julia> obj PyObject NULL julia> py"lambda x: x"(obj) signal (11): Segmentation fault ``` There are two problems: (1) `py"set"("obj")` turns `obj` to `PyNULL` (ref count issue?) and (2) passing `PyNULL` to Python function is not guarded enough. Note that `py"set"` is modeling what we do in PyJulia all the time so it's not a contrived example.