Pyd: Stackthreads and returning arrays from D

Kirk McDonald kirklin.mcdonald at gmail.com
Wed Jun 27 03:32:44 PDT 2007


Simen Haugen wrote:
> Thats not the problem. If I change the test to use a getter method instead, 
> the same error occurs.
> 
> import pyd.pyd;
> 
> class Item {
> }
> 
> class Container {
>     private:
>     Item[] _items;
> 
>     public:
>     Item[] getItems() {
>         return _items;
>     }
> }
> 
> extern(C) void PydMain() {
>     module_init();
> 
>     wrap_class!(Item);
> 
>     wrap_class!(
>         Container,
>         Def!(Container.getItems)
>     );
> }
> 
> 
> The same error:
[snip]
> C:\Python24\lib\site-packages\celerid\infrastructure\pyd\make_object.d(228): 
> fun
> ction pyd.make_object.d_type!(Item[]).d_type expected to return a value of 
> type
> Item[]
> C:\Python24\lib\site-packages\celerid\infrastructure\pyd\make_object.d(289): 
> tem
> plate instance pyd.make_object.d_type!(Item[]) error instantiating
> C:\Python24\lib\site-packages\celerid\infrastructure\pyd\func_wrap.d(274): 
> templ
> ate instance pyd.func_wrap.PydWrappedFunc.fn!(Item[]) error instantiating
> C:\Python24\lib\site-packages\celerid\infrastructure\pyd\func_wrap.d(264): 
> templ
> ate instance pyd.func_wrap._pycallable_asdgT!(Item[] delegate(())) error 
> instant
> iating
> error: command 'c:\d\dmd\bin\dmd.exe' failed with exit status 1
> 

Now /this/ is strange to me. However, it is extraordinarily late, and I 
am far too tired to come up with a cognizant answer at the moment.

-- 
Kirk McDonald
http://kirkmcdonald.blogspot.com
Pyd: Connecting D and Python
http://pyd.dsource.org



More information about the Digitalmars-d mailing list