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


Groups > comp.lang.python > #86540

Re: Python Worst Practices

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <simon+python@bleah.co.uk>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.067
X-Spam-Evidence '*H*': 0.88; '*S*': 0.02; 'subject:Python': 0.06; 'list?': 0.07; 'lawrence': 0.09; 'cc:addr:python-list': 0.11; '7:45': 0.16; '>on': 0.16; '>that': 0.16; 'worst': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'thu,': 0.19; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'case.': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'character': 0.29; 'ease': 0.30; 'code': 0.31; 'anyone': 0.31; 'maintaining': 0.32; 'agree': 0.35; 'add': 0.35; 'useful': 0.36; 'should': 0.36; 'extremely': 0.39; '26,': 0.68; '2015': 0.84; 'complaint': 0.84; 'defensive': 0.84; 'hardly': 0.84; 'received:btcentralplus.com': 0.84; 'subject:Practices': 0.84; 'technique.': 0.84; 'received:86': 0.91; 'to:none': 0.92
User-Agent Kaiten Mail
In-Reply-To <CAPTjJmppMhBuLy=LMC=ycN0RYE9Jp8BVZbdSeqBZupd_7Nwxfw@mail.gmail.com>
References <mclca6$iie$1@ger.gmane.org> <CAPTjJmppMhBuLy=LMC=ycN0RYE9Jp8BVZbdSeqBZupd_7Nwxfw@mail.gmail.com>
MIME-Version 1.0
Content-Transfer-Encoding 8bit
Content-Type text/plain; charset=UTF-8
Subject Re: Python Worst Practices
From Simon Ward <simon+python@bleah.co.uk>
Date Thu, 26 Feb 2015 19:36:02 +0000
CC "python-list@python.org" <python-list@python.org>
X-Spam-Flag NO
X-Spam-Score -1.9
X-Spam-Level -
X-Spam-Report No, score=-1.9 required=5.0 tests=ALL_TRUSTED, BAYES_00, MISSING_HEADERS autolearn=no version=3.3.2
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.19284.1424981390.18130.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1424981390 news.xs4all.nl 2975 [2001:888:2000:d::a6]:46219
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:86540

Show key headers only | View raw



On 25 February 2015 21:24:37 GMT+00:00, Chris Angelico <rosuav@gmail.com> wrote:
>On Thu, Feb 26, 2015 at 7:45 AM, Mark Lawrence
><breamoreboy@yahoo.co.uk> wrote:
>> http://www.slideshare.net/pydanny/python-worst-practices
>>
>> Any that should be added to this list?  Any that be removed as not
>that bad?
>
>Remove the complaint about id. It's an extremely useful variable name,
>and you hardly ever need the function.

You can add one character and avoid the conflict with "id_" and not require anyone else maintaining the code to think about it. As rare as the conflict is, I think the ease of avoiding it makes the extra character a practical defensive technique. I agree it is not a worst case. 

Simon

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


Thread

Re: Python Worst Practices Simon Ward <simon+python@bleah.co.uk> - 2015-02-26 19:36 +0000

csiph-web