Question:

Is it pythonic to pass a list of dictionary keys to iterate, BUT if an empty list is passed, iterate the entire dictionary?

If not suggestions please 😅

My only other approach is two methods, but as there are many features to process this way, it seems overly messy to me.

#python`

@kingfisher one function returns which keys to operate over. If it's all of them, it returns all of them.

A second function iterates over the list of keys it is given.

@tartley As usual I think I have overcomplicated situation.

Based on everyones feedback, now my current thinking is all pass a list and if list empty - give warning.....

To handle the ALL situation just pass the list as the_dict.keys(), which, sigh, I am already doing in many other places.

@kingfisher fair enough! Don't fret, overcomplicating things is every programmer's default mode of operation.🤗

@tartley Then despite the evidence I must be a great programmer!!

Thanks everyone