From: Loïc Simon Date: Sun, 5 Apr 2026 18:31:19 +0000 (+0200) Subject: gh-69605: Add math.integer to PyREPL module completer hardcoded list (#144811) X-Git-Tag: v3.15.0a8~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c64baff1d82e8a113d971869b6074551e99eece9;p=thirdparty%2FPython%2Fcpython.git gh-69605: Add math.integer to PyREPL module completer hardcoded list (#144811) --- diff --git a/Lib/_pyrepl/_module_completer.py b/Lib/_pyrepl/_module_completer.py index 2098d0a54aba..bba59599e979 100644 --- a/Lib/_pyrepl/_module_completer.py +++ b/Lib/_pyrepl/_module_completer.py @@ -23,6 +23,7 @@ HARDCODED_SUBMODULES = { # Standard library submodules that are not detected by pkgutil.iter_modules # but can be imported, so should be proposed in completion "collections": ["abc"], + "math": ["integer"], "os": ["path"], "xml.parsers.expat": ["errors", "model"], } diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index 18e88ce4e772..82628f792799 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -1187,6 +1187,7 @@ class TestPyReplModuleCompleter(TestCase): cases = ( ("import collections.\t\n", "import collections.abc"), ("from os import \t\n", "from os import path"), + ("import math.\t\n", "import math.integer"), ("import xml.parsers.expat.\t\te\t\n\n", "import xml.parsers.expat.errors"), ("from xml.parsers.expat import \t\tm\t\n\n", "from xml.parsers.expat import model"), ) diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-13-07-08.gh-issue-69605.4aL4hn.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-13-07-08.gh-issue-69605.4aL4hn.rst new file mode 100644 index 000000000000..c00b7b99f8ee --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-13-07-08.gh-issue-69605.4aL4hn.rst @@ -0,0 +1 @@ +Add :mod:`math.integer` to :term:`REPL` auto-completion of imports.