Addressing the last element of a list

bonono at gmail.com bonono at gmail.com
Thu Nov 10 21:15:14 CET 2005


After one knows the characteristic, it is no problem. But judging from
the frequency of the same issue coming up from time to time, it does
confuse people coming from certain programming background.

Mike Meyer wrote:
> Only if you have to overcome a conviction that variables behave in a
> different way. If you've never seen them behave another way, or have
> already gotten used to this model from another language (it dates back
> to the 60s, if not the late 50s), then it's no problem. I'm sure the
> problem exists in the opposite direction, except that few people
> travel that route.
>
> Most OO languages do the name/variable thing, but some of the popular
> ones aren't consistent about it, giving some types "special" status,
> so that sometimes "a = b" causes b to be copied onto a, and sometimes
> it causes a to become a pointer to b. I find a consistent approach is
> preferable.
>
> Most OO languages also have the mutable/immutable object thing. The
> set of which objects are immutable changes from language to
> language. It's really only relevant in this case because the solution
> to "I want to change an alias" issue involves using a mutable object.
>
>    <mike
> --
> Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
> Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.




More information about the Python-list mailing list