finished lists section of "native datatypes"

This commit is contained in:
Mark Pilgrim
2009-02-14 15:21:54 -05:00
parent a503fde1f5
commit af01495379
4 changed files with 31 additions and 228 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ Examples:
"""
SUFFIXES = {1000: ('KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'),
1024: ('KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB')}
SUFFIXES = {1000: ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
1024: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']}
def approximate_size(size, a_kilobyte_is_1024_bytes=True):
"""Convert a file size to human-readable form.