Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #197816
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: get_used_memory |
| Date | 2026-06-14 18:18 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <87tsr461p9.fsf@nightsong.com> (permalink) |
| References | (6 earlier) <slrn112rj8p.5fs.jon+usenet@raven.unequivocal.eu> <874ij684ls.fsf@nightsong.com> <slrn112rnrs.5fs.jon+usenet@raven.unequivocal.eu> <877bo07itf.fsf@nightsong.com> <slrn112uifb.5fs.jon+usenet@raven.unequivocal.eu> |
Jon Ribbens <jon+usenet@unequivocal.eu> 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.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
get_used_memory Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-06-12 03:46 +0000
Re: get_used_memory Jon Ribbens <jon+usenet@unequivocal.eu> - 2026-06-12 07:18 +0000
Re: get_used_memory Paul Rubin <no.email@nospam.invalid> - 2026-06-13 12:38 -0700
Re: get_used_memory Jon Ribbens <jon+usenet@unequivocal.eu> - 2026-06-13 19:58 +0000
Re: get_used_memory Jon Ribbens <jon+usenet@unequivocal.eu> - 2026-06-13 20:02 +0000
Re: get_used_memory Paul Rubin <no.email@nospam.invalid> - 2026-06-13 14:13 -0700
Re: get_used_memory Jon Ribbens <jon+usenet@unequivocal.eu> - 2026-06-13 21:35 +0000
Re: get_used_memory Paul Rubin <no.email@nospam.invalid> - 2026-06-13 15:20 -0700
Re: get_used_memory Jon Ribbens <jon+usenet@unequivocal.eu> - 2026-06-13 22:53 +0000
Re: get_used_memory Paul Rubin <no.email@nospam.invalid> - 2026-06-14 17:23 -0700
Re: get_used_memory Jon Ribbens <jon+usenet@unequivocal.eu> - 2026-06-15 00:40 +0000
Re: get_used_memory Paul Rubin <no.email@nospam.invalid> - 2026-06-14 18:18 -0700
Re: get_used_memory Jon Ribbens <jon+usenet@unequivocal.eu> - 2026-06-15 07:20 +0000
Re: get_used_memory Paul Rubin <no.email@nospam.invalid> - 2026-06-15 12:02 -0700
Re: get_used_memory Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-06-14 01:10 +0000
Re: get_used_memory Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-06-14 01:09 +0000
Re: get_used_memory Paul Rubin <no.email@nospam.invalid> - 2026-06-14 01:28 -0700
Re: get_used_memory Lawrence D’Oliveiro <ldo@nz.invalid> - 2026-06-14 23:56 +0000
csiph-web