2.9.0
·
214 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Added
- A new transform to remove
returnstatements that are not required, which is enabled by default.
e.g.
def important(a):
if a > 3:
return a
if a < 2:
return None
a.adjust(1)
return NoneWill be minified to:
def important(a):
if a > 3:
return a
if a < 2:
return
a.adjust(1)-
The f-string debug specifier will now be used where possible, e.g.
f'my_var={my_var!r}'will be minified tof'{my_var=}'.
The debug specifier should now be preserved where it is used in the input source. -
Many small improvements to minification to be more precise about where whitespace or parentheses required
- Thanks luk3yx for improving whitespace in relative import statements.
- A generator as the sole argument to a function call is no longer wrapped in parentheses
- float literals can use a more compact scientific notation
- Many more subtle improvements