Comment

Comment by woodruffw

I've long wanted some kind of "null-filling" destructuring operator in Python, to avoid cases like this:

    # oops, ValueError on `item = "noequals"`
    key, value = item.split("=", 1)
That alone makes destructuring somewhat limited, unless I'm either willing to validate my lengths ahead of time or do exception-driven control flow. Something like `?=` perhaps, to complement the walrus operator.
parent woodruffw 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton