On Mon, 17 Aug 2020 22:54:32 +1200
Greg Ewing
On 17/08/20 9:58 pm, Antoine Pitrou wrote:
Probably because exploiting Python abstraction facilities to build DSLs has/had long been frown upon in this community? That was the leitmotiv back when people were marvelling over Ruby's flexibility in the area.
As far as I remember, what was frowned on was adding weird and wonderful syntax (e.g. function calls without parens) to Python purely because "it might be useful for DSLs".
Notice that such weird and wonderful syntax was proposed again by Guido recently... And as I said, annotations have become a DSL in themselves, and several PEPs are dedicated to that DSL.
There's nothing wrong with using existing features to build DSLs (although people might look askance at you if you use them in particularly obscure ways).
Well, we're not talking about an existing feature in this thread. Regards Antoins.