Closed keesterbrugge closed 3 years ago
Hi there! That's a lot of domain specific code -- are you able to narrow down the problem a little?
The root of this is a different standard definition of map and dict. Map's get method returns nil by definition if the key isn't found and a python dict raises KeyError. I guess the implementation of the Map bridge for python objects is incorrect and it should catch that exception and return nil.
Interesting. My only concern would be that changing the Map bridge globally might have some surprising behavior. KeyError
is supposed to be raised with a missing key in Python, since None
is a valid value :thinking:.
That being said, it would be much more convenient from the Clojure perspective. Trying to think if there would be any unanticipated consequences of this
Hi Chris, thx again for this amazing library.
I'm trying out numpyro for some probabilistic programming.
I suspect something is going wrong. When you desctructure a map on keywords that are missing, they are bound to the value nil, see
The fn
model
takes a map as argument and I bind the value of the:y
key. I thought that the following 3 cases would yield the same result, but case 1 fails. Am I missing something?