scope of function parameters

Chris Rebert clp2 at rebertia.com
Mon May 30 03:27:17 EDT 2011


On Mon, May 30, 2011 at 12:12 AM, Laurent Claessens <moky.math at gmail.com> wrote:
> Le 29/05/2011 23:42, Ben Finney a écrit :
>> Peter Pearson<ppearson at nowhere.invalid>  writes:
>>
>>>  Python works in terms of objects having names, and one
>>>  object can have many names.
>>
>> Or no names. So it's less accurate (though better than talking of
>> “variables”) to speak of Python objects “having names”.
>
> Could you give an example of an object that has no name ? I've missed
> something ...

def foo():
    return 5

print(foo())

The int object 5 has no name here.

Cheers,
Chris



More information about the Python-list mailing list