Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #59496

Re: Implementing #define macros similar to C on python

Path csiph.com!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'debugging': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'language.': 0.14; '#else': 0.16; '#ifdef': 0.16; 'c/c++': 0.16; 'macros.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'sure.': 0.16; 'subject:python': 0.16; 'language': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'written': 0.21; 'example': 0.22; 'python?': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'nearly': 0.26; 'certain': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'received:66': 0.35; 'something': 0.35; 'possible': 0.36; 'similar': 0.36; 'implement': 0.38; 'thank': 0.38; 'nov': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'you.': 0.62; 'subject: #': 0.96; '2013': 0.98
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dave Angel <davea@davea.name>
Subject Re: Implementing #define macros similar to C on python
Date Thu, 14 Nov 2013 21:30:51 -0600
References <fae7479b-ecec-4114-9750-6595fa8c78fa@googlegroups.com> <fae7479b-ecec-4114-9750-6595fa8c78fa@googlegroups.com>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host 66.208.195.17
In-Reply-To <fae7479b-ecec-4114-9750-6595fa8c78fa@googlegroups.com>
User-Agent Groundhog Newsreader for Android
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2635.1384486506.18130.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1384486506 news.xs4all.nl 15917 [2001:888:2000:d::a6]:41572
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:59496

Show key headers only | View raw


On Thu, 14 Nov 2013 18:29:48 -0800 (PST), JL <lightaiyee@gmail.com> 
wrote:
> One of my favorite tools in C/C++ language is the preprocessor 
macros.


> One example is switching certain print messages for debugging use 
only


> #ifdef DEBUG_ENABLE
> DEBUG_PRINT   print
> #else
> DEBUG_PRINT


> Is it possible to implement something similar in python? Thank you.

Sure. A preprocessor can be written for nearly every language. Are 
you offering?

-- 
DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Implementing #define macros similar to C on python JL <lightaiyee@gmail.com> - 2013-11-14 18:29 -0800
  Re: Implementing #define macros similar to C on python Dave Angel <davea@davea.name> - 2013-11-14 21:30 -0600
  Re: Implementing #define macros similar to C on python Chris Angelico <rosuav@gmail.com> - 2013-11-15 14:49 +1100
    Re: Implementing #define macros similar to C on python JL <lightaiyee@gmail.com> - 2013-11-15 15:36 -0800
      Re: Implementing #define macros similar to C on python Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2013-11-16 01:20 +0100
      Re: Implementing #define macros similar to C on python Terry Reedy <tjreedy@udel.edu> - 2013-11-15 19:22 -0500
      Re: Implementing #define macros similar to C on python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-16 00:22 +0000
        Re: Implementing #define macros similar to C on python JL <lightaiyee@gmail.com> - 2013-11-15 21:38 -0800
          Re: Implementing #define macros similar to C on python Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-16 11:48 +0000
  Re: Implementing #define macros similar to C on python Roy Smith <roy@panix.com> - 2013-11-14 23:10 -0500
    Re: Implementing #define macros similar to C on python Chris Angelico <rosuav@gmail.com> - 2013-11-15 15:57 +1100
    Re: Implementing #define macros similar to C on python Serhiy Storchaka <storchaka@gmail.com> - 2013-11-16 12:02 +0200
  Re: Implementing #define macros similar to C on python Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2013-11-16 00:20 +0100

csiph-web