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

Explanation of list reference

In article <mailman.7079.1392602374.18130.python-list at python.org>,
 Chris Angelico <rosuav at gmail.com> wrote:

> On Mon, Feb 17, 2014 at 12:43 PM, Ned Batchelder <ned at nedbatchelder.com> 
> wrote:
> > The correct statement is "all values are objects", or "all data is 
> > objects".
> > When people mistakenly say "everything is an object", they are implicitly
> > only thinking about data.
> >
> > That said, "all data is objects" is really mostly useful in contrast to
> > other languages where some data is objects and some is not.
> Part of the trouble is that some code is (represented by) objects. A
> function is an object, ergo it's data; a module is an object (though
> that's different); a class is an object; but no other block of code
> is.


> So when does code become data? When it's represented by an object.

OK, now take somebody who knows lisp and try to explain to him or her 
why Python's eval() doesn't mean data is code.  Yeah, I know that's 
pushing things a bit, but I'm trying to point out that people come into 
things with pre-conceived notions that are hard to shake (the psychology 
of learning people would call this the Law of Primacy).