◐ Shell
clean mode source ↗

PEP 634: Allow keyword patterns for int, str etc. by gvanrossum · Pull Request #1908 · python/peps

This resolves a discrepancy between the specification and the implementation, in favor of the current implementation. The spec used to state that you can't have patterns like these:

    case int(x, real=0): ...
    case int(real=1): ...

The implementation allows this and there is no good reason to disallow it, so it makes sense to rule that the PEP was mistaken here. (I don't recall why I put it in the PEP and in fact I was surprised to find it there.)