cpython icon indicating copy to clipboard operation
cpython copied to clipboard

Entering interactive mode after -m

Open DimitrisJim opened this issue 2 years ago • 1 comments

Documentation

This might be an omission in the docs or a bug in -m, not certain. Documentation currently states -i used before a script of the -c switch launches the REPL:

When a script is passed as first argument or the -c option is used, enter interactive mode after executing the script or the command [...]

but this works equally well with -m (unless this is also considered a script):

python -i -m timeit "pass"
50000000 loops, best of 5: 4.99 nsec per loop
Traceback (most recent call last):
  File "/home/imijmi/anaconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/imijmi/anaconda3/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/imijmi/anaconda3/lib/python3.9/timeit.py", line 375, in <module>
    sys.exit(main())
SystemExit
>>>

Linked PRs

  • gh-119271

DimitrisJim avatar Feb 22 '23 09:02 DimitrisJim

I'm going to try to work on this during the PyCon2024 sprint, and I'm hoping to get a PR open on May 21, 2024

melaniearbor avatar May 20 '24 19:05 melaniearbor