Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.ag!news2.euro.net!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.032 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'suppose': 0.07; '[1,': 0.09; 'subject:How': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; 'url:html)': 0.16; 'ignore': 0.16; 'wrote:': 0.18; 'input': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In- Reply-To:1': 0.27; 'received:209.85.217': 0.29; 'url:code': 0.29; 'message-id:@mail.gmail.com': 0.30; 'url:python': 0.33; 'comment': 0.34; 'received:209.85': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'url:org': 0.36; 'should': 0.36; 'example,': 0.37; 'received:209': 0.37; 'url:library': 0.38; 'obtain': 0.39; 'how': 0.40; 'read': 0.60; 'to:addr:gmail.com': 0.65; 'subject:read': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=sLQZLveO8qXn14Ic/ToNYZgBP8UetYIQUbHab1XgEuY=; b=giaDrAcE4OBdmRnxu+YQs6P/HLrzLwpYDXe+0comsZlNLwzoRRThvPyKW9u+Oy4+73 XcMvfTUX2cH5D5lqNxoNX6j+gSPJsVn+ClVVoNgoju8g6P3xOI9KMeVwevy8Jah62/71 eWnuDLzaIDLOzIdyw953kZnor7jWVFN+vk7zRdS7G/ogAv8t2bSaLGcs0dXEY7+LheMJ T2G1SihMePBs1NfybyZEyRos5PTfAcM2qA5X7ugpqZI+kzcshcBbdd6cRoAFvAmHM0yi GaFzd8/igql015oYzQ+V/idLkzo8SDDzxrrUmxP1eJwxecpWq8PLCG5+RnMXl3cNEwuT YeaA== MIME-Version: 1.0 X-Received: by 10.112.76.39 with SMTP id h7mr10671824lbw.118.1365443182733; Mon, 08 Apr 2013 10:46:22 -0700 (PDT) In-Reply-To: <4ff75708-f8e4-4ec9-8a4b-e71eb1dc2892@googlegroups.com> References: <4ff75708-f8e4-4ec9-8a4b-e71eb1dc2892@googlegroups.com> Date: Mon, 8 Apr 2013 18:46:22 +0100 Subject: Re: How to do a Lispy-esque read? From: Arnaud Delobelle To: zeta.convex@gmail.com Content-Type: text/plain; charset=UTF-8 Cc: Python 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1365443184 news.xs4all.nl 6885 [2001:888:2000:d::a6]:40025 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43085 On 8 April 2013 08:45, wrote: > Suppose I want to read an object from some stream. How do I do it? > > For example, if the input stream contained the text: > [1, # python should ignore this comment > 2] > > and I do a "read" on it, I should obtain the result > [1, 2] You might be interested in code.compile_command() (http://docs.python.org/2/library/code.html) -- Arnaud