Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.python Subject: Re: get_used_memory Date: Sat, 13 Jun 2026 15:20:31 -0700 Organization: A noiseless patient Spider Lines: 9 Message-ID: <874ij684ls.fsf@nightsong.com> References: <110fvf3$1tqe3$1@dont-email.me> <8733yq9qov.fsf@nightsong.com> <878q8i87p7.fsf@nightsong.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sat, 13 Jun 2026 22:20:32 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3410417"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ZEbS3cwkofUFkzttpdDVK"; posting-host="bd4920ba34529796942315d75078a899" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:yaCEdSL9ID0AckZnp1DWIZQ65jU= sha1:K7w1spiyMIKV+MfxeOZ027m3450= sha256:GMdGJUTV0ZkXYVZJCOCkvWAAngunvcIQW5s3PCPGPuY= sha1:D3KW7S3Af9RHrobkSVih8Fqp9uI= Xref: csiph.com comp.lang.python:197808 Jon Ribbens 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.