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


Groups > comp.lang.python > #95929

Fwd: Strange location for a comma

Path csiph.com!goblin1!goblin.stu.neva.ru!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <kmisoft@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'skip:[ 20': 0.03; 'ignored': 0.05; '(1,': 0.09; 'tuple': 0.09; 'example:': 0.10; 'python': 0.10; 'def': 0.13; 'b):': 0.16; 'comma.': 0.16; 'executables': 0.16; 'ignores': 0.16; 'element': 0.18; 'header:In- Reply-To:1': 0.24; 'least': 0.27; 'message-id:@mail.gmail.com': 0.27; 'function': 0.28; 'print': 0.30; 'definition': 0.34; 'list': 0.34; 'received:google.com': 0.35; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'version': 0.38; 'to:addr:python.org': 0.40; 'some': 0.40; 'your': 0.60; 'vous': 0.61; 'no.': 0.62; 'function)': 0.84; 'subject:location': 0.84; 'url:app': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=rwxGVoioVTdzV9hjeGzfIor2NLbvaxKH0ggob1Nv5K0=; b=jIU+md4th302Pr1Nn0o28/MRvyPuZRqBabjOu0p9dqorefb+fdNkPUmYqVCpm07TL6 xNf8ai7+ELL9B25lebRlq4Qy+eBjf7TcGqnCOblYjuMsHcx+qtuobgSIqVL81WMtGyhL VbUAeJl/Mt7L4Z4ajPHnYnzFjVgZbM4Sa3quOZaFQsBAHsIci6wxdneaqYjDmT4PFekt mNUP5RR7kCMfyYPNYO/sJ682fTW5od4GxTKipWiwGJov9UY/QUKs+BrG7UcqPeDeiZGa CihmF/vvXeRrOtmBuJV9oHU/2Augb1l7DDnQAX3kdS9sD4NTVMDipkc9O1Gl9DDlZJZN GeWg==
MIME-Version 1.0
X-Received by 10.66.136.102 with SMTP id pz6mr68154368pab.52.1441284654548; Thu, 03 Sep 2015 05:50:54 -0700 (PDT)
In-Reply-To <CAK_Erki-eMLZC6ZsTRZLhB_1D37Aa-uvYE+E-u==hUiNeMMi6w@mail.gmail.com>
References <55e83afb$0$3157$426a74cc@news.free.fr> <55e83ce3$0$3327$426a74cc@news.free.fr> <CAK_Erki-eMLZC6ZsTRZLhB_1D37Aa-uvYE+E-u==hUiNeMMi6w@mail.gmail.com>
Date Thu, 3 Sep 2015 08:50:54 -0400
Subject Fwd: Strange location for a comma
From Vladimir Ignatov <kmisoft@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
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.63.1441284664.8327.python-list@python.org> (permalink)
Lines 54
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1441284664 news.xs4all.nl 23724 [2001:888:2000:d::a6]:42433
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:95929

Show key headers only | View raw


>>
>> # On appelle la fonction setup
>> setup(
>>    name = "salut",
>>    version = "0.1",
>>    description = "Ce programme vous dit bonjour",
>>    executables = [Executable("salut.py")],    #  <--- HERE
>> )
>>
>>
>
> Ok its understood, it's a 1 element only tuple
>
> example:
>
>>>> A = 5,
>>>> A
>
> (5,)
>
>>>> A = (6)
>>>> A
>
> 6

No. It's not a tuple in your case (calling 'setup' function)

a = 1,2,  # <- extra comma
print a
b = 1,   # <- extra comma
print b

=>

(1, 2)  # ignored
(1,)    # made tuple

and

def f(a, b):
    print a,b

f(1,2,)   # <- extra comma

=>

1 2  # ignored

Under some circumstances python ignores "excess" comma. At least
inside list definition [1,2,3,]  and function calls f(1,2,)

Vladimir

http://itunes.apple.com/us/app/python-code-samples/id1025613117

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


Thread

Strange location for a comma "ast" <nomail@invalid.com> - 2015-09-03 14:20 +0200
  Re: Strange location for a comma "ast" <nomail@invalid.com> - 2015-09-03 14:28 +0200
    Re: Strange location for a comma Peter Otten <__peter__@web.de> - 2015-09-03 14:48 +0200
    Re: Strange location for a comma MRAB <python@mrabarnett.plus.com> - 2015-09-03 13:50 +0100
    Fwd: Strange location for a comma Vladimir Ignatov <kmisoft@gmail.com> - 2015-09-03 08:50 -0400
    Re: Strange location for a comma Tim Chase <python.list@tim.thechases.com> - 2015-09-03 09:36 -0500
    Re: Strange location for a comma Martin Komoň <martin@mkomon.cz> - 2015-09-03 14:34 +0200
  Re: Strange location for a comma Laura Creighton <lac@openend.se> - 2015-09-03 14:40 +0200
  Re: Strange location for a comma "ast" <nomail@invalid.com> - 2015-09-03 15:01 +0200
  Re: Strange location for a comma Laura Creighton <lac@openend.se> - 2015-09-03 15:02 +0200
  Re: Strange location for a comma "Sven R. Kunze" <srkunze@mail.de> - 2015-09-04 01:01 +0200

csiph-web