Explanation of list reference
steve+comp.lang.python at pearwood.info
Sat Feb 15 07:48:37 CET 2014
On Sat, 15 Feb 2014 17:07:17 +1100, Chris Angelico wrote:
> On Sat, Feb 15, 2014 at 4:36 PM, Steven D'Aprano
> <steve+comp.lang.python at pearwood.info> wrote:
>> References can be names like `mystring`, or list items `mylist`, or
>> items in mappings `mydict["key"]`, or attributes `myobject.attr`, or
>> even expressions `x+y*(1-z)`.
> I agree with most of what you've said, but I'm not sure I like that last
> bit. The expression evaluates to an object, yes, but it's not itself a
> reference... is it?
You may be right. I will have to think about it a little more. Or a lot
more. Ah wait, I got it: I chose a bad example for the expression. Here
is a better one:
I think it is fair to call that both an expression and a reference.
More information about the Python-list