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

Calling python function not expected to work? #274

Open
DavidBriant opened this issue Dec 20, 2020 · 1 comment
Open

Calling python function not expected to work? #274

DavidBriant opened this issue Dec 20, 2020 · 1 comment

Comments

@DavidBriant
Copy link

Just wanted to confirm that there's no way to call python from D at the moment? E.g.

def test_funcs():
    from pyd import appends_to_fn_cb
    import pytest
    #  FIXME
    with pytest.raises(RuntimeError):
        assert appends_to_fn_cb(lambda x: str(x), 42, "post") == \
            "42post"
@DavidBriant
Copy link
Author

Just if anyone else needs this, what I eventually did, as a temporary work around, was:

import deimos.python.abstract_ : PyObject_CallObject;
import deimos.python.object;

export PyObject* callFn(PyObject* fn, PyObject* args) {
    return PyObject_CallObject(fn, args);
}

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

1 participant