
def human(size):
	radix = 1024.
	units = ["B", "KB", "MB", "GB", "TB"]
	n = len(units)
	for u in range(n):
		if size < radix : break
		size /= radix

	return "%f %s" % (size, units[u])

@@ -7,15 +7,254 @@
 uman
-(
+ ( 
 size
-):
+ ) :%0A%0A%09%22%22%22%0A%0A%09%09%3E%3E%3E from lib.bytes import *%0A%09%09%3E%3E%3E human( 23 )%0A%09%09'23.000000 B'%0A%09%09%3E%3E%3E human( 1024 )%0A%09%09'1.000000 KB'%0A%09%09%3E%3E%3E human( 1025 )%0A%09%09'1.000977 KB'%0A%09%09%3E%3E%3E human( 1024 ** 4 )%0A%09%09'1.000000 TB'%0A%09%09%3E%3E%3E human( 1024 ** 5 )%0A%09%09'1024.000000 TB'%0A%0A%09%22%22%22%0A
 %0A%09ra
@@ -309,47 +309,61 @@
 %22%5D%0A%09
-n = len(units)%0A%09for u in range(n):%0A%09%09if
+last = units%5B-1%5D%0A%0A%09for u in units :%0A%09%09if u == last or
  siz
@@ -420,20 +420,16 @@
  %25 (
+ 
 size
+ 
 , u
-nits%5Bu%5D
+ 
 )%0A

increase coverage