Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pymethod don't work with string #3

Closed
byulparan opened this issue Jul 20, 2020 · 2 comments
Closed

pymethod don't work with string #3

byulparan opened this issue Jul 20, 2020 · 2 comments

Comments

@byulparan
Copy link

(py4cl2:pycall "len" #(1 2 3 4))   ;; work
(py4cl2:pymethod #(1 2 3) 'append 10) ;; work
(py4cl2:pymethod #(1 2 3) "append" 10) ;; error

I think it should be support string. because some python library use camelCase.

@digikar99
Copy link
Owner

Hmm, going by consistency, it should work, yes. Thanks for pointing out! Will fix in the next release. The current workaround would be to use || -

(py4cl2:pymethod #(1 2 3) '|append| 10)

@byulparan
Copy link
Author

(ql:quickload :py4cl2)
(py4cl2:defpymodule "sys")
(py4cl2:pycall "sys.path.append" (namestring *default-pathname-defaults*))
(py4cl2:defpymodule "foo") ;; my test python module

(defvar *obj* (foo:foo-object/class :a 10 :b 20))  ;; allocate FooObject instance 
(py4cl2:pymethod *obj* '|runTask|)  ;; call camelCase method. work!

Thank you for reply :-)

digikar99 added a commit that referenced this issue Jul 20, 2020
digikar99 added a commit that referenced this issue Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants