f(n=4) works; bug or feature?

Edward C. Jones edcjones at erols.com
Mon Dec 24 09:48:46 EST 2001


Aahz Maruch wrote:

> In article <3C26B3DA.4000102 at erols.com>,
> Edward C. Jones <edcjones at erols.com> wrote:
> 
>>In Python 2.2, the following code prints a "4".
>>
>>def fun(n):
>>    print n
>>
>>fun(n=4)
>>
>>Bug or feature?
>>
> 
> Feature.  You're using the ability of Python to define keyword arguments
> to functions.
> 

Embarrassment. In this minimal context, it looked like an assignment.




More information about the Python-list mailing list