Carsten Behring

Results 517 comments of Carsten Behring

I think return 0 is as well acceptable for a java hashcode impl (better the nil)

There are some reports that Clerk cannot render the "newsgroup" objects, no sure if same reason. https://clojurians.slack.com/archives/CLR5FD4ET/p1701986985003569

Maybe the code here: https://github.com/clj-python/libpython-clj/blob/073a887e9ddb0f74a48aa34b91b013a67ec71401/src/libpython_clj2/python/ffi.clj#L708 should catch ` TypeError: unhashable type: ` and not throw, but return 0 instead. Just to address the point that "non hashable" in python is...

As a far simpler example, we can take this for discussion: ```clojure (hash (py/->py-dict {:a 1})) ``` This should NOT fail in my view, but it does: ``` 1. Unhandled...

In my view, in the same way we have a default behavoiur for toString: ``` (str (py/->py-dict {:a 1})) ``` which should return "a string" for any libpython object, we...

I am not suggesting to use str as hashing key. In my view, we should "catch" "TypeError: unhashable type", here: https://github.com/clj-python/libpython-clj/blob/073a887e9ddb0f74a48aa34b91b013a67ec71401/src/libpython_clj2/python/ffi.clj#L708 and either: return `0`, as hashcode or return `id()`...

Or check here: https://github.com/clj-python/libpython-clj/blob/073a887e9ddb0f74a48aa34b91b013a67ec71401/src/libpython_clj2/python/base.clj#L178 if the python object is hashable: The presents of attribute "__hash__" can be checked for being "nil" ``` (-> (py/->python "") (py/get-attr "__hash__")) ;; => #object[tech.v3.datatype.ffi.Pointer...

This issue makes Clerk and libpython-clj not work well together. Clerk is based on "value hashing" for caching, and crashes when hash-calculation of a value throws exception.

Just a question here. I noticed that I needed sometimes re-execute the "import" statement, usually I do that by re-evaluation the "ns" macro (as it contains the 'import') Is '(clojure.tools.namespace.repl/refresh-all)'...

Seems fine to me. So "charred" is a more complete json library, you say ? As it supports at least one more datatype , which cheshire does not support ,...