[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I'm wrong or Will we fix the ducks limp?

On Sun, Jun 5, 2016, at 04:01, Marko Rauhamaa wrote:
> You could also think of variables as pegs, references as leashes, and
> objects as cute puppies. One puppy could be held with multiple leashes
> hung on separate pegs. Some puppies hold leashes in their mouths. Every
> leash is tied to a puppy or a special wooden post called None.

You've got it all wrong about what's special about None.  The object is
just another puppy. There *is* a variable called None
[getattr(__builtins__, 'None')] which holds a leash tied to that puppy,
but it's rarely used, since everyone knows how to find that puppy
directly [None is a keyword]. But nothing's special about the object
itself, no more than any other object.

Of course, as the fact that I had to use __builtins__ shows, the "pegs"
are a fiction. At least, as long as we consider that frames and modules
are just another kind of puppy. Though I suppose technically frames are
an implementation detail.