Closed
Description
(require '[libpython-clj2.python :as py :refer [py.. py**] :reload true])
(py/initialize! :python-executable "venv/bin/python")
(require '[libpython-clj2.require :refer [require-python import-python]])
(import-python)
(py/run-simple-string "
class Thing:
def __call__(this, data):
return {a: b for a, b in data.items()}
" )
(py.. (__main__/Thing) (__call__ {} ))
Expected: {}
Actual:
Traceback (most recent call last): File "<string>", line 4, in
__call__ File "<string>", line 4, in <dictcomp> File
"/home/jay/.pyenv/versions/3.7.13/lib/python3.7/_collections_abc.py",
line 743, in __iter__ for key in self._mapping: Exception:
java.lang.NullPointerException:java.lang.NullPointerException: null
Note:
This works
(py.. (__main__/Thing) (__call__ (python/dict {}) )) ;;=> {}
See conversation for more details
Metadata
Metadata
Assignees
Labels
No labels