clj-python / clj-python/libpython-clj

cannot get key from dictionary

Open
#183 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Clojure
Stars
1.2k
Forks
74
PR merge metrics
No merged PRs in 30d

Description

The below code seems to be inconsistent.
Converting a Clojure map to a python dictionary shows presence of key "a".
But then I can not get the key "a" out of it.

(->  {:a 1}
     py/as-python
     (py/py. keys)
     seq)
;; => ("a")

(->  {:a 1}
     py/as-python
     (py/py. get "a")
     seq)
;; => nil

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the two Clojure examples from the issue and compare the result of keys with the result of get on the converted Python dictionary. Trace the map-to-Python conversion and key lookup behavior; done means looking up "a" returns the value 1 consistently with the key listing.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure, python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.