Hacker News new | past | comments | ask | show | jobs | submit login

Although not really what they were intended for, somebody used annotations to provide a macro system [0].

[0] https://tinkering.xyz/abusing-type-annotations/




Author here. Be warned, this was just a proof of concept that I did because I thought it would be fun/weird/interesting!


Oh my goodness. I've committed some naughty deeds with the ast module before, but this is truly, wonderfully, heinous. You push this idea so far that I wouldn't even recognize some of these examples as syntactically valid, let alone predict their effects. I'm awestruck and a little frightened of you.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: