This transform shortens names in the module scope. This includes introducing short names for builtins.
This could break any program that imports the minified module. For this reason the transform is disabled by default.
When enabled, all global names may be renamed if it is space efficient. This includes:
Global import aliases
Global function names
Global class names
Builtin names may be bound to a new name in the module scope
Renaming is prevented by:
vars()are used, renaming is disabled
from <module> import *is used in the module, renaming is disabled
If a name is included as a literal string in
__all__, renaming of that name is disabled
Any name listed in the
Enable this source transformation by passing the
rename_globals=True argument to the
preserve_globals argument is a list of names to disable renaming for.
When using the pyminify command enable this transformation with
may be a comma separated list of names to prevent renaming.