[Tutor] Understanding the error "method got multiple values for keyword argument "

Alan Gauld alan.gauld at yahoo.co.uk
Wed Mar 1 07:04:54 EST 2017


On 01/03/17 10:50, Peter Otten wrote:

>> sees your call as something like:
>>
>> total(name = "John", 1, 2, 10 )
> 
> I think total(name="John", *(1, 2, 3))
> 
> is rather resolved as
> 
> total(1, 2, 3, name="John")
> 

Ah, yes that makes sense. Thanks for the
clarification Peter (and Steven).

The bottom line is don't put positional arguments
after named ones...

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list