hmm – in that case, write a little utility function, which I think is what Chris A suggested. Something like:
In [104]: def joinf(iterable, joiner=", ", format=""):
...: format=f"{{{format}}}"
...: return joiner.join(format.format(i) for i in iterable)
In [105]: some_iter = [1, 2, 5., None]
In [106]: joinf(some_iter)
Out[106]: '1, 2, 5.0, None'
In [107]: joinf(some_iter, ", ", "!a:10s")
Out[107]: '1 , 2 , 5.0 , None
One trick is that the format string would have to work with all the values in the iterable, which makes this less useful, at least for non-homogenous iterables.
Now that I think about it, perhaps a format specifier could be added as an optional parameter to the str.join() method, so your above examples would be:
", ",join(some_iter, format="")
or
", ",join(some_iter, format="!a")
I think that would be a lot less cryptic than adding an implied iteration to a f-string, since str.join()
is already about iteration.