clj-python / clj-python/libpython-clj

from-import does not support "string"

Open
#235 0 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

This syntax cannot be used in libpython-clj,

from yellowbrick.contrib.wrapper import CLASSIFIER

when classifier is a String.

(py/from-import yellowbrick.contrib.wrapper CLASSIFIER)

fails with

 Unhandled java.lang.IllegalArgumentException
   No implementation of method: :get-attr of protocol:
   #'libpython-clj2.python.protocols/PPyAttr found for class: java.lang.String

          core_deftype.clj:  583  clojure.core/-cache-protocol-fn

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 at the py/from-import entry point and reproduce the failure using yellowbrick.contrib.wrapper with CLASSIFIER as a string. Trace how the import target is resolved when it reaches the PPyAttr protocol error. Done means the shown from-import form accepts a string classifier without the IllegalArgumentException and has regression coverage.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.