On Sun, Jul 12, 2020 at 1:16 PM Jim J. Jewett <jimjjewett@gmail.com> wrote:
Federico Salerno wrote:
> On 11/07/2020 19:29, Jim J. Jewett wrote:
> > To me, "else:" has a slightly different meaning than "case _:" ...

> Could you construct two examples to prove behaviour would be different
> between the two?

The behavior would be identical; the difference is in why I put that
behavior there.

    match return_code:
        case -1: ...
        case 4: ...
        case x if int(x) == x:
            pass # This could be a "case _" if not for the guard
    else:
        raise TypeError("Return Code not an integer?!?: ", return_code)

I would write that as:

    match return_code:
        case -1: ...
        case 4: ...
        case x if int(x) != x:
            raise TypeError("Return Code not an integer?!?: ", return_code)