Skip to content

Entering interactive mode after -m #102136

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

Activity

  1. melaniearbor commented on May 20, 2024

    @melaniearbor
    Contributor

    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

  2. added 2 commits that reference this issue on May 20, 2024
  3. added a commit that references this issue on May 20, 2024
  4. added 2 commits that reference this issue on May 20, 2024
  5. added a commit that references this issue on Jul 17, 2024
  6. added 2 commits that reference this issue on Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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