Is there a reference/alias/pointer in Python?

Daniel Eloff danieleloff at hotmail.com
Thu Jul 22 21:36:23 EDT 2004


Maybe I'm still thinking in C++, but see if this makes sense to you.

 

I have a UserOptionsClass that contains program options. It has a
member, Users, that is a dictionary. I defined __getitem__ so that I can
access a users options via OptionsInstance[ 'username' ]. Now I defined
a second member, CurrentUser which is set to the Users [
'current_users_username ' ]. I understand it's ref counted, so that
doesn't make a new copy, but doesn't that also mean that if I change it,
it will be made into a new copy separate from Users [
'current_users_username' ] ? Is there any way I can change that
behaviour?

 

Thanks,

-Dan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20040722/a1b65133/attachment.html>


More information about the Python-list mailing list