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


Groups > comp.lang.python > #46609

Re: How clean/elegant is Python's syntax?

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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; 'argument': 0.05; 'mrab': 0.05; 'subject:Python': 0.06; 'explicit': 0.07; 'string': 0.09; 'subject:How': 0.10; 'def': 0.12; 'argument,': 0.16; 'iterable': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'putting': 0.22; 'bytes': 0.24; 'second': 0.26; 'least': 0.26; 'subject:/': 0.26; 'header :In-Reply-To:1': 0.27; 'tried': 0.27; 'message- id:@mail.gmail.com': 0.30; 'forces': 0.31; 'sep': 0.31; 'objects': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; "you're": 0.61; '30,': 0.65; 'default': 0.69; '2013': 0.98
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=DIkSrZ+WUAIZAus8t6ddX3ETO+PXllq/kTT7oCDqXT0=; b=LGtEU4TnMqn3zhGC15QBCmfnoKwNKUJnpZJ14D7/03TSIfAfFTCK7YZ/mdVWBeyrOI J9AY23ipsq6Pg6JtIMEg8mxeIkwHbkxob0CSGv8saUtL9WSFSozwXPDayfmdvS5j+3In /v6myauFftv7AdN+uHf5dw6tGQZRE6XJ3BV2DI4NhB/f+AosuTALLeTcVZSf3Lh0FQ++ Wo2wB3oTMHyME4L3kNzowTSg2rrpAlqrPN9Z2uRfweoZFKfDzyzHKIyU7cm7xaL4wuIq vDh7s3OwKrNMuV3MYn/CxlYrNgwIBTQA6QgQ2z8fQ79BzR83j/Q0cG+zbMVezyW7jxVa 4cpA==
X-Received by 10.68.247.101 with SMTP id yd5mr13651768pbc.57.1370015074416; Fri, 31 May 2013 08:44:34 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <51A7AAC0.6080509@mrabarnett.plus.com>
References <CAGVx7UWXAFHSHq37Ep-Vk=cM2wYrEGHSUhNc8s43bCvj_VcVow@mail.gmail.com> <CAGGBd_oT=vqvPGZy+d1H=XHjdPCmYUxJMXAwii7WH845xrYybQ@mail.gmail.com> <mailman.2389.1369876474.3114.python-list@python.org> <851ce96a-0223-42b0-8d99-902294c71f58@hc4g2000pbb.googlegroups.com> <CALwzidkvPJFWh1csV+sC6mFb9bZFaft_T5e+5E49eHucBTf-hQ@mail.gmail.com> <CAPTjJmqHE_Ctyn5dEL3TeXaan4_cF9JUWHi_hMb2nyafhpn5CQ@mail.gmail.com> <51A7AAC0.6080509@mrabarnett.plus.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Fri, 31 May 2013 09:43:54 -0600
Subject Re: How clean/elegant is Python's syntax?
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2493.1370015077.3114.python-list@python.org> (permalink)
Lines 11
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1370015077 news.xs4all.nl 15890 [2001:888:2000:d::a6]:59092
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:46609

Show key headers only | View raw


On Thu, May 30, 2013 at 1:38 PM, MRAB <python@mrabarnett.plus.com> wrote:
> And additional argument (pun not intended) for putting sep second is
> that you can give it a default value:
>
>    def join(iterable, sep=""): return sep.join(iterable)

One argument against the default is that it is specific to the str
type.  If you then tried to use join with an iterable of bytes objects
and the default sep argument, you would get a TypeError.  At least not
having the default forces you to be explicit about which string type
you're joining.

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


Thread

Re: How clean/elegant is Python's syntax? Ma Xiaojun <damage3025@gmail.com> - 2013-05-30 09:14 +0800
  Re: How clean/elegant is Python's syntax? rusi <rustompmody@gmail.com> - 2013-05-29 19:49 -0700
    Re: How clean/elegant is Python's syntax? Ian Kelly <ian.g.kelly@gmail.com> - 2013-05-30 12:36 -0600
      Re: How clean/elegant is Python's syntax? rusi <rustompmody@gmail.com> - 2013-05-30 11:47 -0700
      Re: How clean/elegant is Python's syntax? John Ladasky <john_ladasky@sbcglobal.net> - 2013-05-30 15:01 -0700
    Re: How clean/elegant is Python's syntax? Chris Angelico <rosuav@gmail.com> - 2013-05-31 04:44 +1000
    Re: How clean/elegant is Python's syntax? Ian Kelly <ian.g.kelly@gmail.com> - 2013-05-30 12:51 -0600
    Re: How clean/elegant is Python's syntax? MRAB <python@mrabarnett.plus.com> - 2013-05-30 20:38 +0100
    Re: How clean/elegant is Python's syntax? Chris Angelico <rosuav@gmail.com> - 2013-05-31 07:28 +1000
    Re: How clean/elegant is Python's syntax? Ian Kelly <ian.g.kelly@gmail.com> - 2013-05-31 09:43 -0600
    Re: How clean/elegant is Python's syntax? Chris Angelico <rosuav@gmail.com> - 2013-06-01 04:52 +1000

csiph-web