dictionary initialization

Weiguang Shi wgshi at namao.cs.ualberta.ca
Thu Nov 25 14:37:54 EST 2004


Hi,

In article <41a62df4.1003031613 at news.oz.net>, Bengt Richter wrote:
> On Thu, 25 Nov 2004 18:38:17 +0000 (UTC), wgshi at namao.cs.ualberta.ca 
> (Weiguang Shi) wrote:
>You wrote it, so you have to "justify" it ;-)
I guess :-) 

>While I agree that ++ and -- are handy abbreviations, and creating a
>key by default makes for concise notation,  a[i]++ means you have to
>make some narrow assumptions ...
Right, though generalization can be painful for the uninitiated/newbie.

>You can certainly make a dict subclass that behaves that way if you
>want it:
> ...
This is nice even for someone hopelessly lazy as me.

>
>Otherwise the usual ways are along the lines of
>...
I would happily avoid them all.

Thanks a lot,
Weiguang



More information about the Python-list mailing list