What is the most convenient way to join a list of ints to form a str without spaces?
For example [1, 2, 3] will turn '1,2,3'. (without spaces).
I know that ','.join([1, 2, 3]) would raise a TypeError.
I like ','.join(str(i) for i in lst), but it's really not much different than map
str.join will be faster with a list than with a genexp ;-)map becomes an iterable (non-list) anyway. Very rarely does that effect the total runtime of your program in any appreciable way though. You'd need to demonstrate that it's a bottleneck before I'd change the code I think.