Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.018 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'url:pypi': 0.03; 'subject:Python': 0.06; 'runs': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; 'possible?': 0.16; '(you': 0.16; 'wrote:': 0.18; 'example': 0.22; 'cc:addr:python.org': 0.22; '2.x': 0.24; 'file.': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'mix': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'code': 0.31; 'comments': 0.31; "skip:' 10": 0.31; 'url:python': 0.33; "i'd": 0.34; 'received:209.85': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'url:listinfo': 0.36; 'doing': 0.36; 'url:org': 0.36; 'received:209': 0.37; 'pm,': 0.38; 'url:mail': 0.40; 'numbers': 0.61; 'skip:n 10': 0.64; 'subject: #': 0.96; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=jgfy/Ycek5k/zKd7w6IIE2QhZpq9UxTJV0z+ltyhiJI=; b=QOhnGumpR75iDbmt/gRPQU8pGq2czbDvEmVGxygAINwWZTdIg9AdONpUc1KHp4UZ5x z5omt+zOToqojLnI7MvzMsDZx8u2tkgwj1Tt66FXjLDjwZtnFXUgS+Iuu3jYohLgVqDh kr99L88T6jkuudTykYewIxPnuAFo54pli18U6d23n+bM9CPLI6b3yW3t6b4N/ST8NKLp iBAx8P0FE6OS8SbJZHXzqULPhb8D5qgtk7zWdKzpxwQNWCXJ8dgrsf4n9mwc2sYF6fAn hnB/+pRM/urkJxBoCU5QU5dRZlAxvIxNc01whoNyzXrHrhQpv4HmQb0UduUH2eVohZs8 xo3A== MIME-Version: 1.0 X-Received: by 10.224.39.77 with SMTP id f13mr803739qae.96.1369790613697; Tue, 28 May 2013 18:23:33 -0700 (PDT) In-Reply-To: References: Date: Tue, 28 May 2013 18:23:33 -0700 Subject: Re: Python #ifdef From: Dan Stromberg To: Carlos Nepomuceno Content-Type: multipart/alternative; boundary=20cf3074d926f25b4804ddd13a4c Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 57 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369790616 news.xs4all.nl 16006 [2001:888:2000:d::a6]:44570 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:46354 --20cf3074d926f25b4804ddd13a4c Content-Type: text/plain; charset=ISO-8859-1 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" 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 > --20cf3074d926f25b4804ddd13a4c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable


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 vener= able m4: https:= //pypi.python.org/pypi/red-black-tree-mod .=A0 Note the many comments a= dded to keep line numbers consistent.

Sent from my android phone.

On May 28, 2013 12:47 PM, "Carlos Nepomucen= o" <carlosnepomucen= o@outlook.com> wrote:
Are there Python 'preprocessor directives'?

I'd like to have something like '#ifdef' to mix code from Pytho= n 2 and 3 in a single file.

Is that possible? How?
--
http://mail.python.org/mailman/listinfo/python-list
--20cf3074d926f25b4804ddd13a4c--