Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'syntax': 0.04; 'interpreter': 0.05; 'nested': 0.07; 'subject:code': 0.07; 'subject:file': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'finney': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:comment': 0.16; 'subject: ?': 0.16; 'language': 0.16; "python's": 0.19; 'header:User-Agent:1': 0.23; 'header:X -Complaints-To:1': 0.27; 'specified': 0.30; 'comments': 0.31; 'flying': 0.31; 'writes:': 0.31; 'probably': 0.32; 'url:python': 0.33; 'comment': 0.34; 'possible': 0.36; 'url:org': 0.36; 'ben': 0.38; 'somebody': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'eye': 0.61; 'url:3': 0.61; 'back': 0.62; 'email addr:gmail.com': 0.63; 'forward': 0.65; 'future,': 0.83; 'subject:source': 0.84; 'url:reference': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: how to detect comment in source code file ? Date: Wed, 04 Sep 2013 17:02:42 +1000 References: <1fbab13d-bb98-465e-affe-f2fddeec8138@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: rasputin.madmonks.org X-Public-Key-ID: 0xBD41714B X-Public-Key-Fingerprint: 9CFE 12B0 791A 4267 887F 520C B7AC 2E51 BD41 714B X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:Vu1rIwXrPYQkYaYLHSWNUEXkcLE= 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1378278177 news.xs4all.nl 15864 [2001:888:2000:d::a6]:50686 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53600 vnkumbhani@gmail.com writes: > how works python interpreter for finding comment ? It works as specified in the language reference. In particular, see . > if possible find nested comment ? Python's comments are line-end comments only. The syntax does not allow multi-line nor nested comments. -- \ “If you go flying back through time and you see somebody else | `\ flying forward into the future, it's probably best to avoid eye | _o__) contact.” —Jack Handey | Ben Finney