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

alex23 wuwei23 at gmail.com
Thu Jul 4 06:05:23 CEST 2013


On 4/07/2013 1:52 PM, Maciej Dziardziel 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

It was an explicit syntax change for Python3. You can read about the
reasoning behind it here:

http://www.python.org/dev/peps/pep-3102/




More information about the Python-list mailing list