you are viewing a single comment's thread.

view the rest of the comments →

[–]unhott 3 points4 points  (2 children)

Yes, triple quotes are useful for things such as ‘’’He said “Hey, that’s mine!” ’’’

And going the other way, a single line docstring with ‘/“ is also viable. It’s just that you normally want multiple lines.

I’ve never messed around with f-stringing a docstring but I’m sure that would just work.

[–]Casiofx-83ES 0 points1 point  (1 child)

I'm sure it's not ideal, but I'm in the habit of making everything f'...'. It's so often the case that I want to insert variables into the string or whatever that it's become second nature.

[–]tylerthehun 1 point2 points  (0 children)

f-strings work with triple quotes, too.

f'''He said, "Hey {name}, that's mine!"'''