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

jfong at ms4.hinet.net jfong at ms4.hinet.net
Wed Nov 16 21:01:30 EST 2016


Michael Torrie at 2016/11/16 11:15:11AM wrote:
> ... The globals object is a dictionary and is itself
> mutable.  But when we assign a new object to a particular dictionary
> key, it tosses out the old reference and makes the key now refer to the
> new object.  It does not do anything to the old object itself.

The last question: Is it possible, in the current Python version, to re-bind a global name in module "deen" after it was imported "from deen import *"?

> > That's one problem I was concerned. Human beings are very deeply
> > binding on words (names?). We think in words, talk in words,
> > communicate in words. Actually we are living in words. I really don't
> > like that when I said "John is a boy" and was told "No, John is a dog
> > now":-)
> 
> Not quite sure where you're going with that. I would think the idea of
> labels on objects would be fairly natural. I could stick a label that
> says "chair" on a chair, and then later move that label to the couch.
> Same label, different object.  Whether the label makes sense is up to you.

I mean it might be better to have two labels to label chair and couch separately, instead of one:-)

--Jach




More information about the Python-list mailing list