Re: get_used_memory

2026-06-15 Thread Chris Angelico via Python-list
On Tue, 16 Jun 2026 at 01:45, Jon Ribbens via Python-list wrote: > My biggest complaint about := is the arbitrary and mysterious > restrictions on what you can use on the left hand side. You can't > even say "a.b := c". The PEP that introduced ":=" barely even > mentions these restrictions, let al

Re: get_used_memory

2026-06-15 Thread Jon Ribbens via Python-list
On 2026-06-15, Paul Rubin wrote: > 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 so

Re: get_used_memory

2026-06-15 Thread Chris Angelico via Python-list
On Tue, 16 Jun 2026 at 05:41, Rob Cliffe via Python-list wrote: > Chris, you say the restriction is not arbitrary. Well, it seems so to > me. Why not > a.b := c # as Jon mentioned L[2:4] := M[3:5] L[3] := x (a,b) := (c,d) Of > course these would be part of an expression, not complete lines of co

Re: get_used_memory

2026-06-15 Thread Rob Cliffe via Python-list
On 15/06/2026 17:51, Chris Angelico via Python-list wrote: On Tue, 16 Jun 2026 at 01:45, Jon Ribbens via Python-list wrote: My biggest complaint about := is the arbitrary and mysterious restrictions on what you can use on the left hand side. You can't even say "a.b := c". The PEP that introdu