On Sat, Nov 19, 2016 at 3:34 PM, Steve D'Aprano
<steve+pyt...@pearwood.info> wrote:
> What happens if you do this?
>
> spam = eggs = cheese = obj
>
> Is that different from:
>
> spam = obj
> eggs = obj
> cheese = obj
>
>
> or from this?
>
> spam = obj
> eggs = spam
> cheese = eggs
> ...
> These aren't silly questions.

Indeed, they are not silly. It surprised me (as a C programmer) that
the assignments happen left-to-right, rather than right-to-left (in C,
cheese would be set first, then eggs, then spam). These are questions
filled with subtleties.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to