Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on PEP 622 – Structural Pattern Matching. Parent comment
It doesn't bother me since I see that match/case is a whole different context, I know I'm matching, and have no reason to instanciate anything here.
But since Foo(a=1) looks like instanciation, it's obvious to me what it's supposed to match.
I think that's one of the things that motivated to:
- use new keywords, but existing ones like "as", nor symbols;
- force 2 levels of indentation despite the cost of it.
This makes it very clear, with little effort, that the context is completly different.
It will make scanning the code easy, and avoid confusion.
There are no comments on this comment yet.
It doesn't bother me since I see that match/case is a whole different context, I know I'm matching, and have no reason to instanciate anything here.
But since Foo(a=1) looks like instanciation, it's obvious to me what it's supposed to match.
I think that's one of the things that motivated to:
- use new keywords, but existing ones like "as", nor symbols;
- force 2 levels of indentation despite the cost of it.
This makes it very clear, with little effort, that the context is completly different.
It will make scanning the code easy, and avoid confusion.