Self hosting Python? (was: Python is just as good as C++ for real apps)

Russell Turpin russell_turpin at hotmail.com
Thu Jan 24 01:16:49 EST 2002


Gustavo Córdova Avila <gcordova at sismex.com> wrote in message news:<mailman.1011833199.21292.python-list at python.org>...
>   p = Memory.BytePointer()
>   dict = { lotsa stuff }
>   # Assign to "p" the address in memory of dict.
>   p = dict

That last statement isn't doing what you think it is doing.
An assignment wipes out the history of a variable, so after
the snippet above, p and dict are the same dictionary, both 
have type "dict", and the first statement has NO effect on
the current state of p. To create a pointer type, you would 
need something like:

    import Memory
    D = {"eggs": "spam"}
    ptrToD = Memory.AddrOf(D)



More information about the Python-list mailing list