Use list name as string

Aahz aahz at pythoncraft.com
Thu Feb 5 00:09:58 EST 2009


In article <mailman.8810.1233792569.3487.python-list at python.org>,
Rhodri James <rhodri at wildebst.demon.co.uk> wrote:
>
>Fundamentally, the concept of a single unique name for any object isn't
>something built into the language (or, indeed, most languages I can think
>of).  An object can have no names (though it'll promptly get garbage
>collected if it isn't assigned to a name somehow), or just as easily
>one or many names.

Slight tangent: I prefer to use "binding target" ("target" for short) for
the generic term describing the left-hand side of an assignment
statement.  Consider

L[1] = C()

(where L is a list and C is a class)

It seems to me that while L and C are properly described as names, L[1]
is not really a name, it's an expression describing the location to be
used for binding.  (The Python docs also use this terminology, at least
some parts of them.)
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Weinberg's Second Law: If builders built buildings the way programmers wrote 
programs, then the first woodpecker that came along would destroy civilization.



More information about the Python-list mailing list