2

I'm trying to use docstrings w/ triple-quotes in my Jupyter notebooks using Python 2.7 .

I can disable the autoclose brackets/quotes thing but I'm quite keen on them; major increase in workflow.

Does anyone know how to do triple quotes without over-quoting while keeping the autoclose feature?

If I press the " key 3x I get """""";
If I press it 3x and delete once, I get """" pressing; and If I press it 3x and delete twice, I get ""

Annoying, right? How can I have the best of both worlds (autoclose | docstrings) ?

enter image description here

6
  • Nothing is wrong. When you type three " your cursor is at the middle of the resulting six. Thus, anything you type is within the string and has been auto-closed. Commented Apr 8, 2016 at 18:22
  • @MarcJ I tried the double triple quotes but it's not compiling Commented Apr 8, 2016 at 18:36
  • 1
    Type this exact string of characters: """This is working without clicking or otherwise moving the cursor. The result will be a correcly formatted string, because it will have auto-closed the string.Therefore you have both strings and autoclose. Commented Apr 8, 2016 at 18:46
  • 1
    While it may be correct in theory, it is often annoying in practice, when, for example, you want to switch a single quote to a triple quote because your string is getting too long. Commented Aug 2, 2017 at 15:43
  • 1
    (Yeah you can highlight the string and pressing the quote button will put a quote on both sides) Commented Aug 2, 2017 at 15:47

1 Answer 1

1

Nothing is wrong. When you type three " your cursor is at the middle of the resulting six. Thus, anything you type is within the string and has been auto-closed.

Type this exact string of characters: """This is working without clicking or otherwise moving the cursor. The result will be a correcly formatted string, because it will have auto-closed the string. Therefore you have both strings and autoclose.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.