ariovistus / pyd

Interoperability between Python and D
MIT License
157 stars 32 forks source link

Q: how to pass Python's None to D's null? #160

Open mw66 opened 2 years ago

mw66 commented 2 years ago

Hi,

I have a Python variable which default to None, and I need to pass it back to D side as null (basically I'm calling a D function, and want to pass a D null via autowrap), but I got an error:

.dub/packages/pyd-0.14.3/pyd/infrastructure/pyd/make_object.d(704): Couldn't convert Python type 'NoneType' to D type 'TheClassDType'

Is this a bug / enhancement? or there is some work-around?

Thanks.

I'm not sure this is a autowrap or pyd issue, so I logged same issue here:

https://github.com/symmetryinvestments/autowrap/issues/312