python-minifier
python-minifier copied to clipboard
Transform Python source code into its most compact representation
While I know that merging lines via semicolons is an attractive way to save character space, this really should be a feature that can be turned off. I'm currently running...
From `src/python_minifier/transforms/constant_folding.py`, lines 51-54: ```py if isinstance(original_value, float) and math.isnan(original_value): # There is no nan literal. # we could use float('nan'), but that complicates folding as it's not a Constant...
## Description When using `remove_debug=True`, the minifier incorrectly removes entire `if/elif/else` blocks that use `is True` comparisons, even when these are functional code and not debug statements. ## Reproduction ```python...
**Describe the bug** When using the minify tool on ViperIDE to save disk space, the tool renders the `f` in front of an f-string as an extra character, thus converting...
It's possible to compress print statements more then they are now, by replacing end= and newlines by putting them on the same line. E.G. Input: `print("Option A")` `print("Option B")` `print("Option...
Hi! It would be good if `--remove-debug` worked on the negative checks of \_\_debug\_\_, in that case it would just put the body of the if statement in place. Example:...
This PR fixes a bug in `ModulePrinter` where the `indent_char` argument specified during initialization was being ignored. Currently, the printer defaults to using a tab character (`\t`) for indentation, regardless...
Hi. The idea arose to make the common part of the string a constant. That is, if part of the string is repeated in the code, then you should put...
Hi, I hope the tool could support whitespace minification for each line of code, similar to what pyminifier does. For example, the original code: ```python def test(name): return f"Hello, {name}!"...