[Python-ideas] Pattern Matching Syntax
tim.peters at gmail.com
Sat May 5 12:12:49 EDT 2018
>>>> ... I liked the way he _reached_ that conclusion: by looking at real-
>>>> life Python code that may have been written instead to use constructs
>>>> "like this". I find such examination far more persuasive than abstract
>>>> arguments or made-up examples.
>>> I would like to see such examination for PEP 572. And for all other
>>> syntax changing ideas.
>> I did it myself for 572, and posted several times about what I found.
> Could you please give links to these results? It is hard to find something
> in hundreds of messages.
It's no easier for me to find old messages, and you'd just ask for
more & more anyway ;-) The "short course" I already gave didn't skip
Short course: I found a small win frequently, a large win rarely, but
in most cases wouldn't use it. In all I expect I'd use it significantly
more often than ternary "if", but far less often than augmented assignment.
But that's me - everybody needs to look at their own code to apply
It's _applying_ the approach I find persuasive & productive, not
someone else writing up the results of _their_ taking the approach.
I'm not trying to change peoples' minds - just suggesting a more
fruitful way (than abstract arguments, fashion, ...) to make up their
minds to begin with.
> I withdrew some my ideas and patches when my examinations showed that the
> number of cases in the stdlib that will take a benefit from rewriting using
> a new feature or from applying a compiler optimization is not large enough.
Bingo! Note your "my examinations" in that. Someone who hasn't done
their own examination is basically guessing. They may or may not
reach the same conclusions if they did the work, but neither eloquence
nor confidence is a reliable predictor of whether they would. Passion
may even be negatively correlated ;-)
More information about the Python-ideas