On Thu, Aug 27, 2020 at 6:32 PM Steven D'Aprano <steve@pearwood.info> wrote:
Personally, I found your examples underwhelming because they're mostly
repetitions of the same pattern.

That's surprising to me. When I see the same pattern over and over that's when I most want to refactor into a common function/method. The repetition is annoying and the solution is easy and obvious. If the cases were all different it'd be much more complicated and chances are there wouldn't be a simple function that covered all cases.

Do you not usually refactor duplicated code? What *do* you refactor?

 I'd find it more interesting if there
were a larger variety of cases

This sort of sounds like the problem. The examples aren't meant to be interesting.