[EMAIL PROTECTED] wrote:

> I just want an alias. Ideally, I don't want to deal with pointers or
> special reference "types" etc. After all, this is not C++ :)
> 
> I just want to be able to make a reference to any old thing in Python.
> A list, an integer variable, a function etc. so that I, in complicated
> cases, can make a shorthand. If "myRef" could somehow "point at"
> something long an complicated like a[42]["pos"][-4], that might be
> useful.

You can do

shorthand = a[42]["pos"]

...

print shorthand[-4]
shorthand[0] = 42 # if a[42]["pos"] is mutable

But the last indirection must always be given explicitly.

Peter

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to