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:

References <e0ffc562-4016-4b5d-88c3-5a115da16906@googlegroups.com>
Date 2013-07-04 14:10 +1000
Subject Re: Why this code works in python3, but not python 2:
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4201.1372911048.3114.python-list@python.org> (permalink)

Show all headers | 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