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


Groups > comp.lang.python > #86473

Re: Python Worst Practices

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'subject:Python': 0.06; 'json': 0.07; 'list?': 0.07; 'practice,': 0.07; 'arguments': 0.09; 'lawrence': 0.09; 'parsed': 0.09; 'python': 0.11; 'nonetheless': 0.16; 'readable': 0.16; 'runtime.': 0.16; 'worst': 0.16; 'appropriate': 0.16; 'language': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'feb': 0.22; 'example': 0.22; 'tests': 0.22; "shouldn't": 0.24; 'url:02': 0.24; 'header:In- Reply-To:1': 0.27; 'xml': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; '25,': 0.31; 'checked': 0.32; 'problem': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'url:org': 0.36; 'should': 0.36; 'easily': 0.37; 'somebody': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; "couldn't": 0.39; 'to:addr:python.org': 0.39; "you've": 0.63; 'such': 0.63; 'due': 0.66; 'invalid': 0.68; 'url:18': 0.68; 'url:2011': 0.75; 'power': 0.76; '*simple*': 0.84; '2015': 0.84; 'subject:Practices': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=ymlz5Lm7vg0HxaQCBhgXpGBFDlRphqXo/mVOjs3h6Hg=; b=QIDDAPN/WG2TrYNBgxukwRs56GljGD8QpckZdOW/hlNPItRQqzIQduokdy5B4znuU0 FtDfIZuLHp+iCorNo4FltphaxDboTu08JeUmFKwp+xXRglt7oYDHEvdsGmNzClmAaY3T mh5dRvgOlQZyGKGnBDnKObNTRau9mHtLNp9MevMB1Lz5kkYqvUOnURP8sACk+aSW25XA 66agcjaHqUDtFgRW0bW//mUncLzWMrzQ2DdvaqI/go6SiSm5G8fDIcIznc2LqZ91yTFw 6/6lbDgfjY3KopLAMdXl/Wjv2w7lqPxcJg2tGEulW5w7ddIhbA/2kHF29TMXQnlb0+oO 0mrg==
X-Received by 10.68.194.38 with SMTP id ht6mr11692644pbc.36.1424926387126; Wed, 25 Feb 2015 20:53:07 -0800 (PST)
MIME-Version 1.0
In-Reply-To <mclca6$iie$1@ger.gmane.org>
References <mclca6$iie$1@ger.gmane.org>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Wed, 25 Feb 2015 21:52:26 -0700
Subject Re: Python Worst Practices
To Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.19241.1424926390.18130.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1424926390 news.xs4all.nl 2873 [2001:888:2000:d::a6]:60278
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:86473

Show key headers only | View raw


On Wed, Feb 25, 2015 at 1:45 PM, 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?

Using XML for configuration is a good example of a worst practice, but
using Python instead isn't best practice. There are good arguments
that a configuration language shouldn't be Turing-complete. See for
instance this blog post: http://taint.org/2011/02/18/001527a.html

The problem with XML is just that it's not very human-readable; it
doesn't need all the extra power of Python. This may be something
that's hard to appreciate until you've actually experienced an outage
because somebody checked in a configuration change that parsed and
passed tests but nonetheless was invalid due to configuration that
couldn't be evaluated until runtime. A better choice for configuration
would be something that is both easily readable and *simple* such as
JSON or YAML, or an appropriate DSL.

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


Thread

Re: Python Worst Practices Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-25 21:52 -0700
  Re: Python Worst Practices cl@isbd.net - 2015-02-26 10:09 +0000

csiph-web