We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
prefix-in
Observed:
If pyffi is qualified via (require (prefix-in pyffi/ pyffi)), attributes cannot be read off of bound python objects via dot . syntax.
pyffi
(require (prefix-in pyffi/ pyffi))
.
Expected: Not sure. Maybe "just works" or some kind of mention of this in the documentation ideally with a workaround.
Repro:
Save this in py-point-qualified.rkt:
py-point-qualified.rkt
#lang racket ;; load `pyffi` qualified as `pyffi/` (require (prefix-in pyffi/ pyffi)) ;; initialize the python interpreter (pyffi/initialize) (pyffi/post-initialize) ;; define `Point` via `collections.namedtuple` (pyffi/import collections) (pyffi/run* "Point = collections.namedtuple('Point', 'x y')") ;; create a `Point` object and bind it (define py-point (pyffi/run "Point(1, 2)")) (print py-point.x)
Then run it:
$ racket py-point-qualified.rkt py-point-qualified.rkt:20:7: py-point.x: unbound identifier in: py-point.x location...: py-point-qualified.rkt:20:7
Extra info:
This is not an issue if prefix-in is not used:
$ cat py-point-qualified.rkt #lang racket ;; require pyffi (require pyffi) ;; initialize the python interpreter (initialize) (post-initialize) ;; define `Point` via `collections.namedtuple` (import collections) (run* "Point = collections.namedtuple('Point', 'x y')") ;; create a `Point` object and bind it (define py-point (run "Point(1, 2)")) ;; expose py-point (provide py-point) (print py-point.x) $ racket py-point-qualified.rkt 1
The text was updated successfully, but these errors were encountered:
provide
Workaround #2 (comment)
Sorry, something went wrong.
No branches or pull requests
Observed:
If
pyffi
is qualified via(require (prefix-in pyffi/ pyffi))
, attributes cannot be read off of bound python objects via dot.
syntax.Expected:
Not sure. Maybe "just works" or some kind of mention of this in the documentation ideally with a workaround.
Repro:
Save this in
py-point-qualified.rkt
:Then run it:
Extra info:
This is not an issue if
prefix-in
is not used:The text was updated successfully, but these errors were encountered: