prompt-toolkit / ptpython

A better Python REPL
BSD 3-Clause "New" or "Revised" License
5.19k stars 277 forks source link

Paste mode: how to tell ptpython that a function definition ended #589

Open raffaem opened 2 months ago

raffaem commented 2 months ago

I don't understand, when in paste mode, how to tell ptpython that the definition of a function ended and should be executed.

You just run an empty line in ipython, but that doesn't seem to work on ptpython:

➜  ptpython
>>> print("hello")
hello
>>> def myf(ins): 
...     print(ins) 
...  
...  
...  
...  <---- still waiting for user input