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

Joshua Landau joshua.landau.ws at gmail.com
Thu Jul 4 07:10:21 CEST 2013


On 4 July 2013 05:47, alex23 <wuwei23 at gmail.com> wrote:
> On 4/07/2013 2:12 PM, Joshua Landau wrote:
>>
>> On 4 July 2013 04:52, Maciej Dziardziel <fiedzia at gmail.com> wrote:
>>>
>>> def foo(*args, bar=1, **kwargs):
>>>      pass
>
>
>> Try "foo(1)" and it will fail -- "bar" needs to be given as a keyword.
>
>
> No it won't, because it is supplied with a default.

Pah! I'm not even thinking.



More information about the Python-list mailing list