3 ms·
Can someone explain this in simpler terms? I think I'm quite proficient in Python for a sysadmin, but I don't understand a single statement in the PEP.
by 7bit 11mo ago
Can someone explain this in simpler terms? I think I'm quite proficient in Python for a sysadmin, but I don't understand a single statement in the PEP.
- eigenspace 11mo agoA macro is a function that takes in parsed code and returns transformed code. The nice thing about macros is that they run during the parsing of the code, so they have no runtime cost associated with them. Basically, you can think of it as a (limited) way for users or packages to add new keywords to a language without having to change the whole language implementation for everyone. Many recent new keywords that were added to Python could have been implemented as macros, which means that they could have just lived in packages rather than needing to be upstreamed into the base language implementation from day 1.