dictionary initialization

BJörn Lindqvist bjourne at gmail.com
Fri Nov 26 16:04:44 EST 2004


> >>> del x 
> >>> x *= 5 
> 
> x should be bound to an object of what type? 
> 
> - 0 because x initialized to 0 by default and 0*5==0? 
> - '' because x initialized to '' by default and ''*5==''? 
> - [] because.... 
> 
> I think this is NOT a problem of explicit/implicit, is just a problem where
> Python can not guess what the user wants... 

Maybe Python can't guess it, but *I* can guess, with 99% certainity,
that the user wants x to be 0. :)

-- 
mvh Björn



More information about the Python-list mailing list