Skip to content

Entering interactive mode after -m #102136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DimitrisJim opened this issue Feb 22, 2023 · 1 comment
Closed

Entering interactive mode after -m #102136

DimitrisJim opened this issue Feb 22, 2023 · 1 comment
Labels
docs Documentation in the Doc dir topic-repl Related to the interactive shell

Comments

@DimitrisJim
Copy link
Contributor

DimitrisJim commented Feb 22, 2023

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

@DimitrisJim DimitrisJim added the docs Documentation in the Doc dir label Feb 22, 2023
@AlexWaygood AlexWaygood added the topic-repl Related to the interactive shell label May 10, 2024
@melaniearbor
Copy link
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

melaniearbor added a commit to melaniearbor/cpython that referenced this issue May 20, 2024
melaniearbor added a commit to melaniearbor/cpython that referenced this issue May 20, 2024
willingc pushed a commit that referenced this issue May 20, 2024
* GH-102136: Add -m to options that work with -i

* Linting
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 20, 2024
* pythonGH-102136: Add -m to options that work with -i

* Linting
(cherry picked from commit 1726902)

Co-authored-by: Melanie Arbor <hellomelaniec@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 20, 2024
* pythonGH-102136: Add -m to options that work with -i

* Linting
(cherry picked from commit 1726902)

Co-authored-by: Melanie Arbor <hellomelaniec@gmail.com>
estyxx pushed a commit to estyxx/cpython that referenced this issue Jul 17, 2024
ambv pushed a commit that referenced this issue Apr 8, 2025
…-119285)

(cherry picked from commit 1726902)

Co-authored-by: Melanie Arbor <hellomelaniec@gmail.com>
ambv pushed a commit that referenced this issue Apr 8, 2025
…-119286)

(cherry picked from commit 1726902)

Co-authored-by: Melanie Arbor <hellomelaniec@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
@ambv ambv closed this as completed Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir topic-repl Related to the interactive shell
Projects
None yet
Development

No branches or pull requests

4 participants