Python's range() function and the match statement treat ranges differently. You create a range using range(start, stop, step) (only positional arguments). But when you match a range in a case statement, you must use case range(start=x, stop=y, step=z). It's a weird quirk, but that's how it works. Don't try to use other keyword names or positional arguments in the case – it won't work.