[Python-ideas] "value" ~ "data" ~ "object"
Lie Ryan
lie.1296 at gmail.com
Fri Apr 16 12:49:42 CEST 2010
On 04/16/10 07:37, Alan Gauld wrote:
>
> "spir ☣" <denis.spir at gmail.com> wrote
>
> Lots of points here and I suspect the English usage will vary greatly
> between
> the different English communities.
>
>> 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"?
>
> I'm not sure I understand your distinction between the two statements.
>
> I think in Python it's true to say that value=object but the rule is not
> commutative.
> object !=value in every case.
I'm sorry, but I'm not sure how you define your equality; in my textbook
equality is a relationship that is "reflexive, symmetric, and
transitive" (commutative is just another way to say symmetric). I'm not
sure what you meant when you say value == object but object != value.
Did you mean value *is an* object but object *is not (necessarily) a* value?
> (A function is an object but is not really a value
> (although it will return a value if called, and of course has an id()
> and is "not None", so in that sense is a value - but that is I think a special
> case)
>
> Data is a concept and is wider than mere values or objects. values can
> be data. But so can rules. Now a rule can be expressed as a function or as a
> mapping, and the mapping will contain values, but the mapping - the relationships
> - are not explicit values, they are rules inherent to the mapping. But the
> mapping is data.
You don't need to define a mapping; since definition of mapping can be
derived from function:
- mapping is the set of all (x, F(x))
but so do function can be defined from a mapping:
- f(x) = y iff (x,y) ∈ {set of 2-tuple}
so we can say that a mapping and function is equivalent:
> Objects differ from pure values in most languages in that they usually
> (always?) have operations (at least a constructor, and in modern Python much
> more). But since I said that all values in Python are objects their difference here
> is moot.
>
>> What useful distinctions are or may be done, for instance in
>> documentation?
>> What kind of difference in actual language semantics may such
>> distinctions mirror?
>
> My dictionary defines data as
> facts or figures from which conclusions can be inferred; information
I guess the problem here is the distinction between data, value, object
depends on how you define it. IOW, trying to make a concrete distinction
from an inconcrete axioms/definition is bound to be futile.
Many Information Systems people like to differentiate between data and
information; most English dictionaries does not.
> facts are not always the same as values (defined as "measures" so by
> definition relative - you can compare values against a known datum of similar type
> (which is another concept again!) but you cannot really compare facts other
> than by their truthfulness, but then, an untruthful fact is not a fact!)
More information about the Python-ideas
mailing list