Aliasing [was Re: [Tutor] beginning to code]

Chris Angelico rosuav at gmail.com
Wed Sep 27 04:11:34 EDT 2017


On Wed, Sep 27, 2017 at 5:38 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Twice you have claimed to be able to write such a swap procedure for
> lists. You can't. If you think you can, it is only because you have
> misunderstood the problem and are writing something else that does
> something different from what the Pascal version does.

I suspect what he's thinking of is a swap_contents() function, which
gives the appearance that the lists have been swapped. That's entirely
possible, but doesn't actually achieve what swap() does.

ChrisA



More information about the Python-list mailing list