Simulating multi-dim array problem - OR - reference confusions

Terry Reedy tejarex at yahoo.com
Tue Apr 16 23:15:22 EDT 2002


"Shane Hoversten" <srh232 at nyu.edu> wrote in message
news:3CBC991C.7090202 at nyu.edu...
> 1) Am I going to get into trouble assuming (using the example above)
that
> b is basically a reference to the sublist a[0]?  I'm not clear how
> sharing works in python.

Someone else answered this.  If still have ??s, ask again.

> 2) Is there a way I can print out the address of a "reference"?

id(ob) return unique int associated with ob, which in CPython happens
to be its address.  Useful for finding out what is going on with
references (learning).  Used in representation of some objects - which
you can do also.

Terry J. Reedy






More information about the Python-list mailing list