Again static type checking is the driver for the change here.
jinjaenv = jinja2.Environment(loader=jinja2.PackageLoader("dedup", "templates"))
def format_size(size):
- size = float(size)
+ sizef = float(size)
fmt = "%d B"
- if size >= 1024:
- size /= 1024
+ if sizef >= 1024:
+ sizef /= 1024
fmt = "%.1f KB"
- if size >= 1024:
- size /= 1024
+ if sizef >= 1024:
+ sizef /= 1024
fmt = "%.1f MB"
- if size >= 1024:
- size /= 1024
+ if sizef >= 1024:
+ sizef /= 1024
fmt = "%.1f GB"
- return fmt % size
+ return fmt % sizef
def function_combination(function1, function2):
if function1 == function2: