help on "from deen import *" vs. "import deen"

jfong at ms4.hinet.net jfong at ms4.hinet.net
Sat Nov 19 04:49:53 EST 2016


Chris Angelico at 2016/11/19 2:58:41PM wrote:
> On Sat, Nov 19, 2016 at 3:34 PM, Steve D'Aprano
> <steve+python at 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

Why this conversation makes me feel like a fool? Are they different?

--Jach



More information about the Python-list mailing list