What’s the best way to have a here document, without newlines at the top and bottom? For example:
print '''
dog
cat
'''
will have newlines at the top and bottom, and to get rid of them I have to do this:
print '''dog
cat'''
which I find to be much less readable.
How about this?
Or so long as there’s no indentation on the first line or trailing space on the last:
Or even, if you don’t mind a bit more clutter before and after your string in exchange for being able to nicely indent it: