Python #ifdef
Dan Stromberg
drsalists at gmail.com
Tue May 28 21:23:33 EDT 2013
Here're slides from a presentation about writing code that runs on 2.x and
3.x: http://stromberg.dnsalias.org/~dstromberg/Intro-to-Python/
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.
Sent from my android phone.
On May 28, 2013 12:47 PM, "Carlos Nepomuceno" <carlosnepomuceno at outlook.com>
wrote:
> Are there Python 'preprocessor directives'?
>
> I'd like to have something like '#ifdef' to mix code from Python 2 and 3
> in a single file.
>
> Is that possible? How?
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130528/44257bb7/attachment.html>
More information about the Python-list
mailing list