- Code: Select all
def foo():
one = """foo foo
bar bar bar"""
print one
two = """
foo foo
bar bar bar
"""
print two
For Cobra, I'm playing with the idea of requiring that the multiline strings be indented one level. My experience with Python is that my programs can look quite strange when the string contents are flush against the left side, which breaks up the indentation of the code. So that would be:
def foo
one = """
foo foo
bar bar bar"""
print one
two = """
foo foo
bar bar bar
"""
print two
I'm also interested in the idea "Multi-line über-raw string literals" at Ideas for Python Enhancements or a variation thereof. Although it's not clear how well that syntax will mesh with popular editors like emacs, vim, TextMate, UltraEdit, etc.
Reactions?