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: Sun, 14 Jun 2026 17:23:24 -0700 Organization: A noiseless patient Spider Lines: 12 Message-ID: <877bo07itf.fsf@nightsong.com> References: <110fvf3$1tqe3$1@dont-email.me> <8733yq9qov.fsf@nightsong.com> <878q8i87p7.fsf@nightsong.com> <874ij684ls.fsf@nightsong.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Mon, 15 Jun 2026 00:23:25 +0000 (UTC) Injection-Info: dont-email.me; logging-data="16706"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ifz33mLY+PEr/pptrbeDj"; posting-host="257e86a47e28abd132d02643f34ebf5c" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:r5diKQuBBIfpAYRJbTj4AXw+EZA= sha1:t1PIwfx3di/0D2eTulfkyC9RWdk= sha256:PMADkZYr22+0e5h1NA5tQSRbg4LishSmmWflnKAMJts= sha1:1/UJ7PAT0YdYCL4ly09a75VyPmA= Xref: csiph.com comp.lang.python:197814 Jon Ribbens writes: > {e[0][:-1]: int(e[1]) for x in xs if (e := x.split())} Does this work? { a : int(b)) for x in xs if (a,b := x.split()) } I think it's ok to keep the ':' in the field name. Otherwise { a.rstrip(':') : int(b)) for x in xs if (a,b := x.split()) } seems a bit more explicit at the expense of a few more chars.