logoalt Hacker News

alextremblay • today at 5:14 PM • 1 reply • view on HN

modern macro systems hook into python's import machinery to handle / expand macros, instead of hooking codes or executing code inside .pth files

Take a look at https://github.com/Technologicat/mcpyrate for example


Replies

rirze • today at 5:54 PM

makes sense (and I somehow missed `mcpyrate` when I scanned the ecosystem for macro packages).

I ended up writing a custom package that expands on the one "macro" (really a small DSL) that does it very quickly, and uses the `.pth` import so it automatically loads, via entrypoint especially, rather than being a constant import in the files that uses the DSL.

`mcpyrate` looks very cool.