Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'compiler': 0.07; 'fix.': 0.09; 'module)': 0.09; 'only,': 0.09; 'ast': 0.16; 'nodes': 0.16; 'pep8': 0.16; 'cc:addr:python-list': 0.16; 'cc:no real name:2**0': 0.20; 'header:In-Reply-To:1': 0.22; 'though.': 0.23; 'cc:2**0': 0.24; 'code': 0.25; 'fix': 0.27; 'expressions': 0.29; 'cc:addr:python.org': 0.29; '(the': 0.30; 'message-id:@gmail.com': 0.33; 'header:User-Agent:1': 0.33; 'instead': 0.33; 'things': 0.34; 'regular': 0.35; 'uses': 0.36; 'received:74.125': 0.37; 'received:google.com': 0.37; 'received:10.0.0': 0.38; 'put': 0.38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=8bOVct4lRztNF5d39yI9w7gYKTuhr8SF7TveabQMjDs=; b=t5aBodH3VpLCoDqgBxjiBDRyKl90pzQwJ5f/8PuXfPT0hHcWj1nUBjutxLIlx71VDU hhlI5Jy+6EJGYRyM5kHGglv9R/td1vRdlqBFp4OaYPDwYU0URE4i9PqG0sbLNer3Eqp9 2Df4u0BJzvnffyEA5nmv/Mmcabv5CWMkw+anA= Date: Tue, 06 Dec 2011 13:22:05 +0000 From: Andrea Crotti User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111108 Thunderbird/8.0 MIME-Version: 1.0 To: "Pedro Henrique G. Souto" Subject: Re: whitespace cleanup References: <4EDDFC48.2000903@gmail.com> <4EDE0166.1030006@gmail.com> <4EDE03BD.2030106@gmail.com> <4EDE07C8.3050004@gmail.com> In-Reply-To: <4EDE07C8.3050004@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 8 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1323177732 news.xs4all.nl 6898 [2001:888:2000:d::a6]:55789 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16727 So apparently PythonTidy uses the AST (the compiler module) to find out the problems, and generates new nodes with a put method to write out the code with the fix. An awful lot of code is needed to make it work apparently, not very neat. Pep8 instead uses tokenize and regular expressions only, and the code is much neater, not sure how is possible to make it fix things though.