Pyd: Stackthreads and returning arrays from D
Kirk McDonald
kirklin.mcdonald at gmail.com
Tue Jun 26 13:32:03 PDT 2007
Simen Haugen wrote:
> Pyd doesn't work with stackthreads in newers versions of the dmd compiler
> (1.014+ at least). As I understand from the documentation and my testing,
> this means I cannot return arrays from D to Python (and renders Pyd quite
> useless for me).
>
> "Pyd uses StackThreads for its iteration wrapping support. By setting this
> to False, opApply wrapping, Iter, and AltIter will be unavailable."
>
> Has anyone found a simple workaround for this?
>
>
No, StackThreads has nothing to do with arrays. It is strictly for
wrapping opApply overloads in classes. Currently, Pyd will convert D
arrays to Python lists (except for char[] and wchar[], which are
converted to the Python str and unicode types, respectively). Because
this is a less-than-optimal solution in a number of ways, I plan on
eventually writing a Python type that wraps D arrays more directly.
--
Kirk McDonald
http://kirkmcdonald.blogspot.com
Pyd: Connecting D and Python
http://pyd.dsource.org
More information about the Digitalmars-d
mailing list