Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'subject:Python': 0.06; 'pypi': 0.07; 'happen.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'sorts': 0.16; 'subject:versions': 0.16; 'wrote:': 0.18; 'module': 0.19; 'version.': 0.19; 'this?': 0.23; 'header:User-Agent:1': 0.23; 'unicode': 0.24; 'this:': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'experiences': 0.30; "i'm": 0.30; 'comments': 0.31; 'easier': 0.31; 'but': 0.35; 'doing': 0.36; 'hi,': 0.36; 'somebody': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'tell': 0.60; 'different': 0.65; 'forward': 0.65; 'thomas': 0.65 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ned Batchelder Subject: Re: Pylint across Python versions Date: Mon, 10 Feb 2014 10:36:50 -0500 References: <317fd2a4-186b-4b97-ad7f-084609d0a9a4@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 18.189.30.229 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <317fd2a4-186b-4b97-ad7f-084609d0a9a4@googlegroups.com> 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392046619 news.xs4all.nl 2961 [2001:888:2000:d::a6]:59511 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65826 On 2/10/14 6:39 AM, thomas.lehmann@adtech.com wrote: > Hi, > > somebody who can tell me about pylint experiences across > different Python version. > > Example: > I'm using a construct like this: > > if sys.version.startswith("3."): > unicode = str > > The reason is that Python 3 does not have this > function anymore but pylint yells for Python < 3 > about redefinition also it does not happen. > > How to get forward with this? > > Regards, > Thomas > Pylint may have a difficult time understanding what you are doing here. You can use pylint comments to tell it to shut up when you know better. But also, you might find it easier to use the "six" module from PyPI to handle these sorts of differences. It's easier than doing it ad-hoc with your own logic. -- Ned Batchelder, http://nedbatchelder.com