[Python-ideas] aliasing

Peio Borthelle peio.borthelle at gmail.com
Thu Sep 1 15:19:16 CEST 2011

Le 31 août 2011 à 17:20, python-ideas-request at python.org a écrit :

> I have often thought that would be a nice to have feature, but to be 
> honest, I have never found a use for it that was absolutely necessary. I 
> have always found another way to solve the problem.
> To make it work using just ordinary assignment syntax, as you suggest, 
> requires more than just an "alias" function. It would need changes to 
> the Python internals. Possibly very large changes. Without a convincing 
> use-case, I don't think that will happen.
> So even though I think this would be a neat feature to have, and 
> possibly even useful, I don't think it is useful enough to justify the 
> work needed to make it happen.
> -- 
> Steven

I don't agree with you when you say there is no necessary use case, e.g. I have two images in a gui and they must stay at the same position (relatively one to the other) but follow the movements of the arrow keys (truthful!). You can't do it by using an intermediate list because the list object is mutable but his data not:
>>> list = [3,]
>>> a = list[0]
>>> list[0] = 6
>>> a
I really don't see any other solution, even I'm sure it would be a twisted operation and I don't find it very pythonic...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20110901/e709cdba/attachment.html>

More information about the Python-ideas mailing list