3 ms·
> I thought it used tagged pointers like other dynamic languages. No. IIRC tagged pointers were considered too complex to expose via Python’s C API.
by pansa2 7y ago
> I thought it used tagged pointers like other dynamic languages.
No. IIRC tagged pointers were considered too complex to expose via Python’s C API.
- matheusmoreira 7y agoIn Ruby C extensions it works like this: int FIXNUM_P(VALUE object_pointer) { return object_pointer & 1; } long FIX2LONG(VALUE object_pointer) { return object_pointer >> 1; } VALUE ruby_value; long number; if (FIXNUM_P(ruby_value)) number = FIX2LONG(ruby_value); I thought this was pretty simple. What does Python's C API look like?
- __s 7y agohttps://mail.python.org/pipermail/python-dev/2004-July/046139.html https://mail.python.org/pipermail/python-dev/2004-July/04613... -1000 from GvR
- userbinator 7y agoHere's his actual reply: https://mail.python.org/pipermail/python-dev/2004-July/046147.html https://mail.python.org/pipermail/python-dev/2004-July/04614...