[Python-ideas] "value" ~ "data" ~ "object"

spir ☣ denis.spir at gmail.com
Thu Apr 15 20:13:48 CEST 2010


On Thu, 15 Apr 2010 14:31:49 +0100
Conrad Irwin <conrad.irwin at googlemail.com> wrote:

> 
> On 04/15/2010 12:37 PM, spir ☣ wrote:
> > Hello,
> > 
> > I have been recently thinking at lexical distinctions around the notion of data. (--> eg for a starting point http://c2.com/cgi/wiki?WhatIsData) Not only but especially in Python. I ended up with the following questions:
> > Can one state "in Python value=data=object"?
> > Can one state "in Python speak value=data=object"?
> > 
> > What useful distinctions are or may be done, for instance in documentation?
> > What kind of difference in actual language semantics may such distinctions mirror?
> 
> Uh.. you are trying to have a discussion about detailed semantics
> without defining what you mean by any of your terminology.

This is precisely the point: how to properly use given terms -- giving them semantic distinctions or not.

> [...]

> (and for the most part, objects with the same values have different data too).

Right, this makes sense for me. And do you mean data are different as soon as located at different places in memory even if bit-per-bit equal? Or only that value holds a notion of interpretation (due to the type)?

> [...]

> It shouldn't
> be necessary to make the distinction between an object and its value in
> documentation (though it is (I presume) occasionally useful in actual
> code to distinguish objects with the same datum, perhaps in cycle
> detection).

Thank you. Let us take the case of a simple assignment:
   name = expression
Once the expression is evaluated, what we get is commonly called a value, right? But in numerous places the result of data lookup is called object instead. While conceptually, for me, it's exactly the same thing.
   x.a = 1
results in an attribute 'a' with "value" 1, in x.
   b = x.a
looks up for the "object" denoted to by the attr name 'a' in x.

(I'm not trying to annoy people, just to clarify common notions.)

> Conrad



________________________________

vit esse estrany ☣

spir.wikidot.com



More information about the Python-ideas mailing list