Printing variable names
danb_83 at yahoo.com
Sun Jan 18 23:51:33 CET 2004
Mark McEahern <mark at mceahern.com> wrote in message news:<mailman.479.1074455535.12720.python-list at python.org>...
> Mike wrote:
> >mylist = [a, b, c]
> >I want to print out the names of the variables in mylist (not the
> >values of a, b, and c). How do I go about doing this. Thanks.
> There's no simple answer to this. Consider the fact that you can have
> more than one name bound to any given mutable instance.
Why did you specify "mutable"? The same applies to immutable
> I'm curious what problem you're trying to solve.
So am I. The question shows up here all the time, but I've never seen
a reason for it.
More information about the Python-list