spiraldb / ziggy-pydust

A toolkit for building Python extensions in Zig.
https://pydust.fulcrum.so/
Apache License 2.0
381 stars 16 forks source link

Support creating PyLong from arbitrary sized integers #310

Open gatesn opened 6 months ago

gatesn commented 6 months ago

Using the int.from_bytes() function to construct an integer from a base-256 byte array.

See https://docs.python.org/3/c-api/long.html#c.PyLong_FromString

https://github.com/fulcrum-so/ziggy-pydust/blob/develop/pydust/src/types/long.zig#L33-L36