Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: A name refers to an object, an object has a value, equality compares values Date: Wed, 25 Nov 2015 08:44:29 +0200 Organization: A noiseless patient Spider Lines: 90 Message-ID: <87egfe7f3m.fsf@elektro.pacujo.net> References: <56544BAB.9020709@rece.vub.ac.be> <874mgbpnb5.fsf@elektro.pacujo.net> <486929d1-4caa-403c-89e6-c45d7b447f98@googlegroups.com> <5655035c$0$1609$c3e8da3$5496439d@news.astraweb.com> <201511250055.tAP0tpfO005889@fido.openend.se> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="22555"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aFf6mVL3MnUmklSuk0muS" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:s99mIVeVnpn0zGtzKKNE7c4e5SE= sha1:MEE+JlfXi7hYaXvx+Z1y+WhhPmY= Xref: csiph.com comp.lang.python:99416 Ben Finney : > Indeed, in the past I used the term “value” as synonymous (in Python > context) with the term “object”. I have become convinced through this > discussion that I should no longer use the terms that way. > > [...] > > The concepts are distinct, so I apologise for misleadingly conflating > them in my terminology. I don't think the meaning of the word "value" can be restricted in that way. Let's try to "refactor" the examples I had found in the wild: "How to get the value of a variable given its name in a string" => How to get the object a variable is bound to given the name of the variable in a string "The value of some objects can change. Objects whose value can change are said to be mutable" [no change] "I'm taking the return value of one function and using it as the argument of another function" => I'm taking the return object of one function and using it as the argument of another function "Don't get confused — name on the left, value on the right" => Don't get confused — name on the left, object on the right "We can print the current value of the dictionary in the usual way" [no change] "A return statement ends the execution of the function call and "returns" the result, i.e. the value of the expression following the return keyword, to the caller" => A return statement ends the execution of the function call and "returns" the result, i.e. the resulting object of the expression following the return keyword, to the caller "When we ask python what the value of x > 5 is, we get False" => When we ask python what the resulting object of x > 5 is, we get False "To display the value of a variable, you can use a print statement" => To display the value of the object a variable is bound to, you can use a print statement "Get a value of a specified key" => Get an image object of a specified key In a word, it's a lost cause. It is actually somewhat comical how Python documentation tries, but fails, to maintain terminological orthodoxy: A mapping object maps hashable values to arbitrary objects. [...] A dictionary’s keys are almost arbitrary values. Values that are not hashable, that is, values containing lists, dictionaries or other mutable types (that are compared by value rather than by object identity) may not be used as keys. [...] Dictionaries can be created by placing a comma-separated list of key: value pairs within braces [...] The first object of each item becomes a key in the new dictionary, and the second object the corresponding value. If a key occurs more than once, the last value for that key becomes the corresponding value in the new dictionary. [...] d[key] = value Set d[key] to value. [...] values() Return a new view of the dictionary’s values. Marko