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 email@example.com wrote:
On Thu, Jul 22, 2021 at 1:14 AM Sven Voigt firstname.lastname@example.org wrote:
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 -- email@example.com To unsubscribe send an email to firstname.lastname@example.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://email@example.com/message/2IOA23... Code of Conduct: http://python.org/psf/codeofconduct/