Python equivalent of Java Vector

Alex Martelli aleaxit at yahoo.com
Wed Oct 4 10:21:16 EDT 2000


"Christopher Browne" <cbbrowne at news.hex.net> wrote in message
news:slrn8ti28n.3vuf8tf.cbbrowne at test.sdt.com...
    [snip]
> Which means that safely accessing entries requires something like:
>   if a.has_key(k):
>     do something with a[k]
>   else:
>     do whatever is needed if there is no a[k]

    dosomething(a.get(k,some_default))

is often handier.


Alex






More information about the Python-list mailing list