On Aug 16, 3:35 pm, beginner <[EMAIL PROTECTED]> wrote:
>
> In perl it is just one line: $a=$b->{"A"} ||={}.
>

a = b.setdefault('A', {})

This combines all two actions together:
- Sets b['A'] to {} if it is not already defined
- Assigns b['A'] to a

More info on dict methods here:

http://docs.python.org/lib/typesmapping.html

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to