Optional parenthesis for sequences in Pattern Matching

When matching a sequence, am I right in saying that the surrounding round/square brackets will be optional?

I experimented with 3.10.0.rc2 and it seems that’s the case.

I poured over the ‘What’s New In Python 3.10’ page but there’s only clarification on tuple and list being treated the same.

Thinking out loud, I wonder if black will end up enforcing a style.

Round brackets are always optional for tuples. They always have been and as far as I know they are in all situations. Including pattern matching.

Looking at PEP 643 or the language reference you can seen that open_sequence_pattern, which features a , but no brackets, is one of the options.

Pattern matching behaves the same way destructuring in that there is no distinction between different sequence types.

Maybe I’ve misunderstood the question, could you explain more precisely, perhaps with a code example, what you’re worried about?

You have not misunderstood the question at all, I was just curious.