Skip to content

Entering interactive mode after -m #102136

Closed
@DimitrisJim

Description

@DimitrisJim

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirtopic-replRelated to the interactive shell

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions