4 ms·
So the gist is: allow executing code at compile-time once, to not let it run a runtime again and again. And as a side-effect, you can implement new syntax-feat
by slightwinder 6y ago
So the gist is: allow executing code at compile-time once, to not let it run a runtime again and again.
And as a side-effect, you can implement new syntax-features, without polluting the interpreter.
Actually a nice idea. Surely something most devs wish to have from time to time. Though, it's also dangerous and can lead to even more unreadable code. Linter will probably also have "fun" adapting to this. And debugging this..
Well, anyway, personally I don't like the syntax. Putting a sign at words end feels just not pythonic. The Idea itself I favor more than I dislike it, as the advantages seems to outweight the disadvantages. As this is a PEP, I assume this will come in any case?
- duckerude 6y ago> As this is a PEP, I assume this will come in any case? A PEP is just a proposal. The index (https://www.python.org/dev/peps/pep-0000/ https://www.python.org/dev/peps/pep-0000/) lists about 170 PEPs that are abandoned, withdrawn or rejected.
- throwaway894345 6y agoNot only more unreadable code, but probably even more correctness problems since you don’t have a type checker validating the expansions (writing correct macros is even harder than writing correct code).