Open tbooth opened 11 months ago
I had a look at the standard for docstrings, which are a common Python example of multi-line strings (https://peps.python.org/pep-0257/) but that simply says putting a newline right after the opening quotes is optional. I used the format I tend to use myself with but I guess I'm not really fussed either way.
Regarding when to use robust quoting, my current approach in my real workflows is to use robust quoting consistently for everything, rather then looking at each case and adding the r
only when necessary. So I taught it the way I do it. But then you might fairly point out that I'm not using r"..."
for regular quotes, so this is inconsistent.
Given that none of the examples in the main workflow rely on the r
, perhaps this should be relegated to chapter 13 after all. It does make the code more readable.
I've removed mention of r-strings until ep13. Still on the fence about how to place the text within the quotes.
From @jdblischak
I know you recommend using
r"""
to make the quoting more robust, but personally I find this more readable:compared to your recommendation:
Especially since this example doesn't require robust quoting.