On Sun, Dec 27, 2020 at 4:30 PM Brendan Barnwell <brenb...@brenbarn.net> wrote:
>         That said. . . I'm starting to wonder why not just create a new dunder
> called __items__ and have dict alias that to .items().  Then the
> **-unpacking protocol could use that and everything would be fine, right?
>

+0.95.

If we could borrow the time machine and create this protocol way back
in Python's past, I think it'd be the best. The semantics of
maintaining backward compatibility MAY complicate things... but then
again, iterator protocol is a bit complicated too, and everyone's fine
with just defining __iter__.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/M5XJF4SI2FRTOEUIXVXJXD6IXWWBISR7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to