getting memory usage of varaibles

Erik python at lucidity.plus.com
Wed May 3 19:30:13 EDT 2017


On 03/05/17 23:21, Larry Martell wrote:
> But not for a variable like a list or dict?

What name should "[1, 2, 3]", or "{1, 'a': 2: 'b'}" be given?

The thing about functions or classes is that you can't (at the literal 
source level) define them *without* giving them a name:

def func(): pass
class cls: pass

But lists and tuples and ints and strings and dicts and sets and floats 
and probably something else I've forgotten can be spelled as anonymous 
literals.

E.




More information about the Python-list mailing list