Skip to content

Commit 6888b5c

Browse files
FeodorFitsnerclaude
andcommitted
Drop interactive/dev-only stdlib modules from embedded packages
Running an app in embedded mode never enters the interactive REPL, so the REPL/dev-only modules are dead weight. Confirmed via import trace (a plain script imports none of them; site.py only touches _pyrepl/rlcompleter inside the interactive hook). Remove from all platform excludes: _pyrepl (~300 KB), rlcompleter, tabnanny, the easter eggs this/ antigravity, and the frozen demo modules __hello__/__phello__. Deliberately kept (a library or breakpoint() may import them): unittest (mock), pdb/bdb, pydoc, doctest, code/codeop, multiprocessing, venv. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2fa0a42 commit 6888b5c

4 files changed

Lines changed: 35 additions & 0 deletions

File tree

android/python-android-dart.exclude

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ lib/python*/test
1919
lib/python*/tkinter
2020
lib/python*/turtle*
2121
lib/python*/wsgiref
22+
# Interactive-REPL / dev-only modules + easter eggs / frozen demos (never imported when
23+
# running a script in embedded mode).
24+
lib/python*/_pyrepl
25+
lib/python*/rlcompleter*
26+
lib/python*/tabnanny*
27+
lib/python*/antigravity*
28+
lib/python*/this*
29+
lib/python*/__hello__*
30+
lib/python*/__phello__
2231
man
2332
share
2433
*/__pycache__

darwin/python-darwin-stdlib.exclude

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,13 @@ test
1818
tkinter
1919
turtle*
2020
wsgiref
21+
# Interactive-REPL / dev-only modules — never imported when running a script (embedded
22+
# mode); plus easter eggs and frozen demo modules.
23+
_pyrepl
24+
rlcompleter*
25+
tabnanny*
26+
antigravity*
27+
this*
28+
__hello__*
29+
__phello__
2130
*/__pycache__

linux/python-linux-dart.exclude

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ lib/python*/test
1818
lib/python*/tkinter
1919
lib/python*/turtle*
2020
lib/python*/wsgiref
21+
# Interactive-REPL / dev-only modules + easter eggs / frozen demos (never imported when
22+
# running a script in embedded mode). Globs catch the .pyc too (sources go via *.py above).
23+
lib/python*/_pyrepl
24+
lib/python*/rlcompleter*
25+
lib/python*/tabnanny*
26+
lib/python*/antigravity*
27+
lib/python*/this*
28+
lib/python*/__hello__*
29+
lib/python*/__phello__
2130
lib/itcl*
2231
lib/tcl*
2332
lib/thread*

windows/python-windows-dart.exclude

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ Lib/lib2to3
1212
Lib/site-packages/pip*
1313
Lib/site-packages/setuptools*
1414
Lib/site-packages/wheel*
15+
# Interactive-REPL / dev-only modules + easter eggs / frozen demos.
16+
Lib/_pyrepl
17+
Lib/rlcompleter.py
18+
Lib/tabnanny.py
19+
Lib/antigravity.py
20+
Lib/this.py
21+
Lib/__hello__.py
22+
Lib/__phello__
1523

1624
# Optional/test/GUI extension modules and DLLs.
1725
DLLs/_test*.pyd

0 commit comments

Comments
 (0)