Python nvim advice

Hello
I am primarily a cpp/c programmer looking to move to python for some ML applications for my research.

I am trying to extend my nvim to work well for python. I have already setup pyright ls with efm (mypy, black) for lsp + lint + format. So that part works great
What I need help with is shell, repl/debugging. I will be grateful for any and all recommendations or suggestions

  1. For C, Cpp etc I used vim-dispatch by tpope. I have tried setting up dispatch for python by configuring the buffer variable b:dispatch = 'python %' but that does not work well as the shell is not interactive.
    For now I am just launching :terminal (with custom vimscript to make it toggleable/hideable).
    What do others here use for interactive shell for python from within vim?

  2. As for debugger, I used to use vim’s native termdebug packages for Cpp. I am aware of nvim-dap + necessary plugins but I kinda prefer the simple termdebug.
    Is there a way to set it up for python? The debuggers I found from basic searches were pdb++ and pudb, both of which being python modules, I dont know how to configure them with termdebug
    Doing something like let g:termdebugger='python -m pudb' does not work.
    Writing a bash script that goes python -m pudb $@ and setting that script to termdebug variable does not work either.
    Can anyone recommend any other program or how to setup termdebug for these options?

  1. I’d recommend installing GitHub - radenling/vim-dispatch-neovim: Adds neovim support to vim-dispatch so you can leverage the built-in terminal emulator with vim-dispatch.

  2. I think :Termdebug only works with gdb. I don’t write a lot of Python unfortunately so I don’t know what the best option is for debugging.

Thank you for your suggestions. I have installed vim-dispatch-neovim.
I also found a thread on nvim github that has a PR in the works for interactive shell!

As to debug, I found an article that describes how to debug python using gdb itself. Will give that a go today

I live in python everyday. Honestly, first I’d recommend you get comfortable with the native debugger by dropping breakpoint() in your code; then graduate to ipdb and ipython. Once you get comfortable with that pipeline all other debuggers will feel like bloat.