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


Groups > comp.lang.python > #49805

Re: Why this code works in python3, but not python 2:

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:not': 0.03; 'subject:code': 0.07; 'arguments': 0.09; 'feature.': 0.09; 'subject:Why': 0.09; 'python': 0.11; 'def': 0.12; '**kwargs):': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:python3': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'versions': 0.24; 'software.': 0.24; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'anyone': 0.31; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'simply': 0.61; 'happen': 0.63; 'jul': 0.74; 'subject:this': 0.83; 'subject::': 0.85; '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:date:message-id:subject:from:to :content-type; bh=6B/24mibTMBDu37cLkX7Jc8wdD6yJVFTiYtM+EsxttM=; b=uMEeHwYM0Bc0sOBGpcMVmEwQ96ghR9/MeisG+b8iroOWqO3ixgmciuXKIiAB470Lzn zO3ROdrQtPpBsJQsdkxctbakiKLHDUl+KDW+E81XHPI7lPHZyzbfFg/3+mlxlx8+Z0q/ XDzsnNqjijJ/9Bu1hoeopLq/RqIFFO30Zxf223o93lqQ0r6Ra591HLi6VozDu1Ro0RLZ rf/ZZKyn3tUemFrOq2wtIA8lIge/h0CjV1wxoIIoFaiGCnCdsVP9BaLiPd0rKSMlMuBp aPrscSxPk4qxx5WN8LIRuQZn0oSqBX2CyBF5BNiOG0DTor1l3wNSt59krgNYf/3+VbfW wB2g==
MIME-Version 1.0
X-Received by 10.52.93.106 with SMTP id ct10mr1301841vdb.83.1372911039919; Wed, 03 Jul 2013 21:10:39 -0700 (PDT)
In-Reply-To <e0ffc562-4016-4b5d-88c3-5a115da16906@googlegroups.com>
References <e0ffc562-4016-4b5d-88c3-5a115da16906@googlegroups.com>
Date Thu, 4 Jul 2013 14:10:39 +1000
Subject Re: Why this code works in python3, but not python 2:
From Chris Angelico <rosuav@gmail.com>
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.4201.1372911048.3114.python-list@python.org> (permalink)
Lines 11
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1372911048 news.xs4all.nl 15863 [2001:888:2000:d::a6]:40672
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:49805

Show key headers only | View raw


On Thu, Jul 4, 2013 at 1:52 PM, Maciej Dziardziel <fiedzia@gmail.com> wrote:
> Out of curiosity: Does anyone know why the code below is valid in python3, but not python2:
>
> def foo(*args, bar=1, **kwargs):
>     pass

Keyword-only arguments are (IIRC) a Py3-only feature. There are lots
of features that don't work in Python 2 - that's simply the way things
happen with old versions of software.

ChrisA

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


Thread

Why this code works in python3, but not python 2: Maciej Dziardziel <fiedzia@gmail.com> - 2013-07-03 20:52 -0700
  Re: Why this code works in python3, but not python 2: alex23 <wuwei23@gmail.com> - 2013-07-04 14:05 +1000
    Re: Why this code works in python3, but not python 2: Maciej Dziardziel <fiedzia@gmail.com> - 2013-07-03 21:31 -0700
  Re: Why this code works in python3, but not python 2: Chris Angelico <rosuav@gmail.com> - 2013-07-04 14:10 +1000
  Re: Why this code works in python3, but not python 2: Joshua Landau <joshua.landau.ws@gmail.com> - 2013-07-04 05:12 +0100
    Re: Why this code works in python3, but not python 2: alex23 <wuwei23@gmail.com> - 2013-07-04 14:47 +1000
      Re: Why this code works in python3, but not python 2: Joshua Landau <joshua.landau.ws@gmail.com> - 2013-07-04 06:10 +0100

csiph-web