Steven D'Aprano wrote:
The first one just does a name lookup and then throws the result away. The second one looks up names a and b, then adds them together, throwing away the result.
Actually, it's worse than that. :-) It's possible for a to have an __add__ method with a side effect, although that would be evil. It's also possible for merely looking up a name to have a side effect, if it's done in the right context -- but that would be even more evil. -- Greg -- https://mail.python.org/mailman/listinfo/python-list