On Thu, Nov 26, 2015 at 2:13 AM, Ned Batchelder <n...@nedbatchelder.com> wrote: > I agree with you: there are things about Python that surprise people. > That's because it's a programming language, and very very little about > programming languages is obvious. The best we can hope for is "familiar," > and even then, familiar to who? High school algebra students will at > first be baffled by "x = x + 1", an equation which is clearly > unsatisfiable.
And then *lots* of people are confused by "x += 1" being almost, but not entirely, identical to the above. Actually, if there were one change I could make to Python, it would be to redefine the augmented assignment operators to be semantically identical to their expanded forms; there might be some optimizations, but absolutely no difference in effect. (Which would mean, among other things, that it would be a very bad way to append to a list, instead of being an alias for .extend.) ChrisA -- https://mail.python.org/mailman/listinfo/python-list