I could say the same thing about JSON dumps then and most itertools functions. The proposed functionality is in line with existing functionality and extends it to the case of nested data structures.

On Wed, Jul 21, 2021 at 11:25 AM Chris Angelico <rosuav@gmail.com> wrote:
On Thu, Jul 22, 2021 at 1:14 AM Sven Voigt <svenpvoigt@gmail.com> wrote:
>
> Paul,
>
> I agree that the mapping to a flat data structure might have limited use cases. However, like you said it is only one example. What I am proposing is a nested iteration tool that can map both keys and values to new keys and new values. It only considers nesting in dictionaries, lists, and tuples by default, but allows users to pass another function to continue searching for pointers in other types.
>

This sounds like the sort of thing that's best coded up specifically
to your purposes. There'll be myriad small variants of this kind of
traversal, so it's easiest to just write the thing you want, rather
than try to get the standard library to support every variant.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@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/2IOA23Z33434YWPTQWDPMA5RGJBCPCRZ/
Code of Conduct: http://python.org/psf/codeofconduct/