|
|
|
|
|
by scardine
3116 days ago
|
|
Python is very hackable. Some time ago I answered a couple questions about how to implement a "pipe" operator in Python at stackoverflow: * “Piping” output from one function to another using Python infix syntax[1] * How can I create a chain pipeline? Often in Python it is not a matter of it being possible/impossible (to implement a different syntax), it has more to do with being always ultra-idiomatic. The zen of Python says "Special cases aren't special enough to break the rules" and the community tends to avoid writing a DSL like the plague. [1] https://stackoverflow.com/questions/33658355/piping-output-f... [2] https://stackoverflow.com/questions/47474704/how-can-i-creat... |
|
While Python decorators and operators can get you surprisingly far, I just don't see them being in the same league as languages like Lisp and R that let you manipulate the AST really easily.
Agreed though that the culture of Python is the exact opposite of R (and Ruby, Perl, Lisp), and even if Python had all the same metaprogramming goodies as R you wouldn't see as widespread use.