Python #ifdef

Grant Edwards invalid at invalid.invalid
Wed May 29 11:25:56 EDT 2013


On 2013-05-29, Chris Angelico <rosuav at gmail.com> wrote:
> On Thu, May 30, 2013 at 12:55 AM, Grant Edwards <invalid at invalid.invalid> wrote:
>> On 2013-05-29, Dan Stromberg <drsalists at gmail.com> wrote:
>>
>>> And in case you still want a preprocessor for Python (you likely don't need
>>> one this time), here's an example of doing this using the venerable m4:
>>> https://pypi.python.org/pypi/red-black-tree-mod .  Note the many comments
>>> added to keep line numbers consistent.
>>
>> I was wondering whether or not to mention m4.  Since m4 is (in my
>> mind) inextricably linked to RATFOR and sendmail config files I try
>> to avoid thinking about it lest the flashbacks start again...
>
> It's not a bad tool. I used it as a sort of PHP preprocessor, 
> [...]
> But still, GNU M4 is a decent piece of technology.

I didn't mean to disparage m4 -- it always seemed well thought out and
useful.  It just happens to be associated with unpleasant things for
me.  [And it didn't really seem like a good option for the OP's
problem.]

Still, if one really did want a preprocessor for Python programs, m4
would be the first thing I'd look at.

-- 
Grant Edwards               grant.b.edwards        Yow! I wonder if I ought
                                  at               to tell them about my
                              gmail.com            PREVIOUS LIFE as a COMPLETE
                                                   STRANGER?



More information about the Python-list mailing list