pointer

Joshua Marshall jmarshal at mathworks.com
Tue Apr 9 16:50:57 EDT 2002


Oleg Broytmann <phd at phd.pp.ru> wrote:

>    In Python *everything* is a pointer. Really.

That's an implementation detail--it would be possible to use non-pointer
bit-patterns for some objects.  For example, some implementation of Python might
store ints that fit into 29-bits as a single word consisting of the integer
followed by three tag bits.  The other seven tag-bit patterns could be used to
designate pointers (now forced to lie on 8-byte boundaries), small strings, etc.

To emulate the semantics of pointers, I like using single-element lists, as some
others have suggested.



More information about the Python-list mailing list