Earlier quoted context omitted.
And the same in Python: if user := get_user() is not None: # use user else: # return error Although given the happy path code can mean you don't see the error condition for ages, I much prefer this: if (user := get_user()) is None: # return error # use user
hehehe. reminds me of if err != nil in Go which is really not an issue in my opinion. But it seems to have become somewhat infamous in some circles.
Although it will flag unused variable. So you will have to make an effort to deliberately ignore the error value.
Still not quite as nice as the compiler forcing you to handle the error case.