Re:Taichi Lang
by adgjlsfhk1 on Thursday March 09, 2023 @07:27PM
(#35088888)
as of 2020 (PEP 638), python has macros (but they're still slightly janky). Before that there were decorators which look kind of similar but are a lot less powerful.
[ Parent
| on HN ]
Re:Taichi Lang
by nerpderp82 on Thursday March 09, 2023 @09:03PM
(#35089549)
Are they implemented anywhere? It looks like the PEP is draft. You can do all the macro like things you want using framehacks and eval at the top level. Where they are hard to apply w/o direct support is down inside some function. Then you have to bytecode patch the result on first execution.
Re:Taichi Lang
by mathisfun123 on Friday March 10, 2023 @01:36AM
(#35091153)
> as of 2020 (PEP 638)
>> Reference Implementation >> None as yet.
> but they're still slightly janky
maybe you're from the future?
Re:Taichi Lang
by BerislavLopac on Friday March 10, 2023 @03:43AM
(#35092075)
Not just decorators, but all kinds of functionalities that allowed types to be constructed at runtime.