On Wed, Sep 2, 2015 at 10:26 PM, Steven D'Aprano <st...@pearwood.info> wrote: >> I think I understand how it gets these results >> but I'm not really happy with them. I think python >> should give the second result in both cases. > > Apart from breaking backwards compatibility, how would you implement such a > thing? A simple left-to-right assignment rule is easy to implement and easy > to understand even when the targets depend on each other.
I don't think this is really a question of implementation - it's a design question of "should". The current behaviour is reasonably sane. But if you're confused by it, there's a simple solution: Don't reference the same "thing" more than once on the LHS. ChrisA -- https://mail.python.org/mailman/listinfo/python-list