
On 4/13/2021 4:21 AM, Baptiste Carvello wrote:
Le 12/04/2021 à 03:55, Larry Hastings a écrit :
* in section "Interactive REPL Shell":
For the sake of simplicity, in this case we forego delayed evaluation.
The intention of the code + codeop modules is that people should be able to write interactive consoles that simulate the standard REPL. For example: Python 3.10.0a7+ (heads/master-dirty:a9cf69df2e, Apr 12 2021, 15:36:39) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.
import code code.interact() Python 3.10.0a7+ (heads/master-dirty:a9cf69df2e, Apr 12 2021, 15:36:39) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) # Call has not returned. Prompt is from code.InteractiveConsole. def f(x:int): -> float
f.__annotations__ # should match REPL result
^Z
now exiting InteractiveConsole...
Now back to repl
If the REPL compiles with "mode='single' and spec is changes to "when mode is 'single'", then above should work. Larry, please test with your proposed implementation. -- Terry Jan Reedy