> def stringify(*args, *, sep:str=SomeDefault): > I meant def stringify(*args, sep:str=SomeDefault)
So an idea would use duck typing to find out if we have 1 iterable or a multiple stuff : def stringify(*args, sep:str=SomeDefault, fmt=''): it = args[0] if len(args) == 1 and hasattr(args[0], '__iter__') else args return sep.join(format(x, fmt) for x in it) But 🦆 duck typing is nasty... I don't want that in the stdlib (but in a pip package, sure!)
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/