0
with open("foo.txt", mode="create") as f:
    print(file, text[0:300], file=f)

ValueError: invalid mode: 'create'

Now pointint the cursor on =open=, followed by hitting , h offers:

  • helm-pydoc which asks to select one of the imported modules
  • lsp-describe-thing-at-point which displays amongst others ..mode:OpenTextMode =...
  • pylookup-lookup which offers a large list where the word open appears

None does help me understand the problem, nor lead to the documentation of mode

How can I access the python documentation for the thing at point?

2
  • 1
    Lsp module uses dash to show documentation; should be enabled/installed by default, but you need to add the package dash-docs to your configuration and download the documentation (Python 3, Numpy, Scipy, etc).
    – Ian
    Commented Jul 24, 2021 at 8:28
  • Try to use elpy.
    – aadcg
    Commented Jul 28, 2021 at 13:51

1 Answer 1

1

One good solution that works here is by using simply pydoc (not helm-pydoc). Put your cursor somewhere on open and do M-x pydoc-at-point-no-jedi. Of course, you can bind some shortcut for it also.

1
  • The command should be available after you synced (git pull) Spacemacs, and restarted it. Commented Sep 30, 2021 at 7:37

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.