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 18:18:26 -0700 Organization: A noiseless patient Spider Lines: 14 Message-ID: <87tsr461p9.fsf@nightsong.com> References: <110fvf3$1tqe3$1@dont-email.me> <8733yq9qov.fsf@nightsong.com> <878q8i87p7.fsf@nightsong.com> <874ij684ls.fsf@nightsong.com> <877bo07itf.fsf@nightsong.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Mon, 15 Jun 2026 01:18:26 +0000 (UTC) Injection-Info: dont-email.me; logging-data="37702"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX184u8ITb3yssFP1bGzQXo+3"; posting-host="257e86a47e28abd132d02643f34ebf5c" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:CKS3lORS0QgT6u4XEv3jf5FGAd0= sha1:143vN4zjNt2hxQW3rq8jUqMPUg4= sha256:AbkutwMciKHW9YfYjk6rINRrDJ4iBkdOowkBy0VzzPw= sha1:uPRH0ALZ8JEzSQqo6EOhaYcirGI= Xref: csiph.com comp.lang.python:197816 Jon Ribbens writes: >> { a : int(b)) for x in xs if (a,b := x.split()) } > No, for three reasons. Firstly, the lines with units result in x.split() > having 3 members, so you can't assign it to a 2-tuple. Oh yes I had intended to say x.split()[:2] but somehow left that out. > Secondly, it appears that (a, b := x) means "create a tuple whose > first member is a and whose second member is x, and also assign x to > b", which is not at all what we need. Yuck, I had expected tuple unpacking. Sounds like a pitfall comparable to "=" vs "==" that kept the := operator out of the language for so long. Oh well.