On Sun, Oct 10, 2021 at 01:51:52AM +0900, Stephen J. Turnbull wrote:
> Christopher Barker writes:
> 
>  > But last time, one of the use cases was "get [an arbitrary] item
>  > from a dict", and there really is not a terribly easy (and
>  > efficient) way to do that now.
> 
> What's wrong with thedict.popitem()?  Works in Python 2.7, BTW.

It removes the key and value, not just retrieve them.


-- 
Steve
_______________________________________________
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/ZCEBLT2TD6VXBDIUM6XRIOQQ5CNVCA3P/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to