getting memory usage of varaibles

Chris Angelico rosuav at gmail.com
Wed May 3 21:09:12 EDT 2017


On Thu, May 4, 2017 at 10:32 AM, Ned Batchelder <ned at nedbatchelder.com> wrote:
> On Wednesday, May 3, 2017 at 8:09:59 PM UTC-4, Steve D'Aprano wrote:
>> On Thu, 4 May 2017 09:30 am, Ned Batchelder wrote:
>>
>> > Functions, classes, and modules can also be referred to by a number of
>> > variables:
>> >
>> >     def foo(): pass
>> >     bar = baz = foo
>> >
>> > But functions (by virtue of the name in the def statement) have an
>> > inherent name,
>>
>> Indeed; but we also have anonymous functions:
>
> Yes, I was trying to make a simple point, without pulling too much other
> esoterica.  I guess I should have known better. :)

On this list? Yep. You should have. :)

Of course, even anonymous functions/modules etc do have names. The
names are just blank or otherwise unhelpful. In contrast, lists and
dicts fundamentally don't _have_ names. You'd have to subclass to add
one of your own.

ChrisA



More information about the Python-list mailing list