]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-69605: Add math.integer to PyREPL module completer hardcoded list (#144811)
authorLoïc Simon <loic.simon@espci.org>
Sun, 5 Apr 2026 18:31:19 +0000 (20:31 +0200)
committerGitHub <noreply@github.com>
Sun, 5 Apr 2026 18:31:19 +0000 (19:31 +0100)
Lib/_pyrepl/_module_completer.py
Lib/test/test_pyrepl/test_pyrepl.py
Misc/NEWS.d/next/Core_and_Builtins/2026-02-14-13-07-08.gh-issue-69605.4aL4hn.rst [new file with mode: 0644]

index 2098d0a54aba31660b99a58b427d02e808b4c761..bba59599e979233a2b9352b425f08ae8da0cf5ef 100644 (file)
@@ -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"],
 }
index 18e88ce4e7724a844acd2f8f3aec1bd153497878..82628f792799309914e663d6b6d85f0c8090323a 100644 (file)
@@ -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 (file)
index 0000000..c00b7b9
--- /dev/null
@@ -0,0 +1 @@
+Add :mod:`math.integer` to :term:`REPL` auto-completion of imports.