Fixes #126 · clj-python/libpython-clj@c71d674 · GitHub
Skip to content

Commit c71d674

Browse files
committed
Fixes #126
1 parent 3b0c79f commit c71d674

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions

‎deps.edn‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{:paths ["src"]
22
:deps {org.clojure/clojure {:mvn/version "1.10.2" :scope "provided"}
3-
cnuernber/dtype-next {:mvn/version "7.13"}
3+
cnuernber/dtype-next {:mvn/version "8.00"}
44
net.java.dev.jna/jna {:mvn/version "5.7.0"}
55
org.clojure/data.json {:mvn/version "1.0.0"}}
66

‎src/libpython_clj2/python/bridge_as_jvm.clj‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@
310310
iterator-seq
311311
set)))
312312
(get [this obj-key]
313-
(py-call "__getitem__" obj-key))
313+
;;Specifically return nil to match java map expectations
314+
;;and thus allow destructuring.
315+
(when (py-call "__contains__" obj-key)
316+
(py-call "__getitem__" obj-key)))
314317
(getOrDefault [item obj-key obj-default-value]
315318
(if (.containsKey item obj-key)
316319
(.get item obj-key)

‎test/libpython_clj2/python_test.clj‎

Lines changed: 7 additions & 0 deletions

0 commit comments

Comments
 (0)