How to overwrite expanded triple quotes
When I type a string in PyCharm, I can open the quotes, type my string, then overwrite the quote on the right side of the string by simply typing another quote. I don't need to use the right arrow to get out of the string. But when I use triple quotes, attempting to close the triple-quote string by typing quotes just types more quotation marks, it doesn't overwrite the three quotes automatically filled in by PyCharm. To close the string, I need to either move my hand over to the right arrow, or type three more quotation marks and then delete three.
Is there any way to configure PyCharm to just overwrite the quotes on the right hand side of a triple-quote string? All I could find in settings was to disable the feature completely, which I don't want.
请先登录再写评论。
Hi there,
I'm afraid this is just the way this feature works at the moment, there is no dedicated setting to change this subtlety in its behavior. Besides, see, in a single quoted string literal you can't include another quote of the same type anywhere unless you explicitly escape it, yet in triple-quoted strings you can use up to two quotes in a row if they're not adjacent to terminating ones. Automatically skipping them would be bothersome if you really wanted to type something like """foo""bar""" (two extra quotes in the middle). Before typing "bar" (without quotes) you would find yourself right before the last quote and have to close the literal by hand which is not what other people might expect.