David Bear wrote:
> Let's say I have a list called, alist. If I pass alist to a function,
> how can I get the name of it?
>
> alist = range(10)
>
> def afunction(list):
> listName = list.__name__ (fails for a list object)
>
Using an object's name as data isn't a good idea because it will
g
On Wed, 22 Jun 2005 09:00:23 +0100, rumours say that Simon Brunning
<[EMAIL PROTECTED]> might have written:
>> Let's say I have a list called, alist. If I pass alist to a function,
>> how can I get the name of it?
>
>The effbot put it beautifully:
And IMO it should be in the FAQ:
(http://www.pyth
On 6/22/05, David Bear <[EMAIL PROTECTED]> wrote:
> Let's say I have a list called, alist. If I pass alist to a function,
> how can I get the name of it?
The effbot put it beautifully:
"The same way as you get the name of that cat you found on your porch:
the cat (object) itself cannot tell you i
David Bear wrote:
> Let's say I have a list called, alist. If I pass alist to a function,
> how can I get the name of it?
>
> alist = range(10)
>
> def afunction(list):
> listName = list.__name__ (fails for a list object)
>
You don't, see the other reply.
You didn't say why you think you n
David Bear wrote:
> Let's say I have a list called, alist. If I pass alist to a function,
> how can I get the name of it?
>
> alist = range(10)
>
> def afunction(list):
> listName = list.__name__ (fails for a list object)
In general, you don't. A particular object can have any number of name
Let's say I have a list called, alist. If I pass alist to a function,
how can I get the name of it?
alist = range(10)
def afunction(list):
listName = list.__name__ (fails for a list object)
--
http://mail.python.org/mailman/listinfo/python-list