bigint <-> python long

Ellery Newcomer ellery-newcomer at utulsa.edu
Wed Sep 5 18:43:45 PDT 2012


On 09/05/2012 05:02 PM, bearophile wrote:
> Ellery Newcomer:
>
>> Investigating the possibility of providing this conversion in pyd.
>
> Are you updating Pyd? :-)
>
> Bye,
> bearophile

Yep. Have any suggestions for supported conversion out of the box? From 
the standard library, I already have Complex, Tuple, and now BigInt. Was 
thinking maybe the datetime stuff..

Also, which of the following looks more appealing to you?


wrap_class!(Foo, Def!(Foo.bar, PyName!"__len__"))();

wrap_class!(Foo, Len!(Foo.bar))();


they wrap Foo and give it an overriden __len__; the latter is how it is 
done at the moment (with similar templates for the other operators), but 
boost::python does something akin to the former. PyName is in the former 
because Def takes too many optional string arguments.


More information about the Digitalmars-d-learn mailing list