[Steven D'Aprano]
> But if I try to create a regular dict from this, dict() doesn't call my
> __getitem__ method:
>
> >>> dict(d)
>
> {0: ('a', 'extra_data'), 1: ('b', 'extra_data')}
>
> instead of {0: 'a', 1: 'b'} as I expected.
>
> How can I fix this?

Try using dict(d.items()).


Raymond

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

Reply via email to