Re: get_used_memory

Paul Rubin <[email protected]> Sat, 13 Jun 2026 15:20:31 -0700
Newsgroups comp.lang.python
Organization A noiseless patient Spider
Message-ID <[email protected]>
Jon Ribbens <[email protected]> writes:
> Lawrence's version used your neat dict(line.split()[:2] ...) trick.

Maybe this:

   dict((a,int(b)) for a,b in (x.split()[:2] for x in xs))

I feel like there should be a way to do this with the := operator
instead of the nested generators, but it doesn't seem to be there.