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


Groups > comp.lang.python > #65826

Re: Pylint across Python versions

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 <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.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 <ned@nedbatchelder.com>
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 <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.6629.1392046619.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

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


Thread

Pylint across Python versions thomas.lehmann@adtech.com - 2014-02-10 03:39 -0800
  Re: Pylint across Python versions Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-10 13:03 +0000
  Re: Pylint across Python versions Chris Angelico <rosuav@gmail.com> - 2014-02-11 00:59 +1100
  Re: Pylint across Python versions Ned Batchelder <ned@nedbatchelder.com> - 2014-02-10 10:36 -0500

csiph-web