Replace decimal prefix(kB) with binary prefix (KiB) for bytes

107 views
Skip to first unread message

Markus Holtermann

unread,
Jan 12, 2015, 6:53:37 PM1/12/15
to django-d...@googlegroups.com
Hey folks,

I saw that the Django docs currently use file size units kB, MB, etc.
that refer to a multiple of 1000 (1000, 1000000 bytes respectively --
https://docs.djangoproject.com/en/dev/ref/settings/#file-upload-max-memory-size
). But the numbers actually are to the power of 1024. To remedy
inconsistencies there are binary prefixes KiB (Kibibyte), MiB
(Mebibyte), etc. which refer to 1024 and 1048576 bytes respectively (
http://en.wikipedia.org/wiki/Binary_prefix )

The Python documentation itself changed the notation about 2 years ago (
http://bugs.python.org/issue17193 ) -- Thanks for the hint, Berker.

I therefore propose to change the notation to use the binary prefix.

I opened a ticket to track this proposal:
https://code.djangoproject.com/ticket/24140

Input and thoughts welcome :)

/Markus

signature.asc

Russell Keith-Magee

unread,
Jan 12, 2015, 7:40:40 PM1/12/15
to Django Developers

See also 19348 and 8733. 


My opinion hasn't really changed - my experience has been that Kibi and Mebi are prefixes that nobody outside standards organisations give a damn about. 

In the example you provide (FILE_UPLOAD_MAX_MEMORY_SIZE), the size that is enforced is 2621440; 2.5 MB is given as an indicative size - saying 2.5 MiB might technically be more correct, but doesn't improve clarity of expression in any way, IMHO. And someone actually checking their file system will quite often be using an operating system that reports MB in 1024 blocks - "df -h" under Unix file systems, for example, reports 1013412 kB as 990 MB (tested on Ubuntu 12.04). So us being "more correct" won't actually make it any easier for end users to work out what's going on.

So, count me as -0. 

Russ %-)
 


/Markus

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/54B45E6B.5080505%40markusholtermann.eu.
For more options, visit https://groups.google.com/d/optout.

Collin Anderson

unread,
Jan 12, 2015, 7:54:35 PM1/12/15
to django-d...@googlegroups.com
I'd be fine changing MB -> MiB in just docs wherever needed, and then not using KB or MB at all because of their ambiguity. I've seen "KiB" and "MiB" around before, but I've never seen "Mebi" before today.

Aymeric Augustin

unread,
Jan 13, 2015, 1:54:45 AM1/13/15
to django-d...@googlegroups.com
In that case I believe it's more important to be understandable by our target audience than to be technically correct. If we make the change we'll probably get bug reports pointing out KiB as a typo.

I know that geeks love to feel smart by being more correct than the masses, so I expect this change will be made eventually, but I'm -0 like Russell.

--
Aymeric.

James Bennett

unread,
Jan 13, 2015, 3:58:01 AM1/13/15
to django-d...@googlegroups.com
-1.

The conflict between niche "technically correct terminology even if no-one actually uses these words" terms and "technically incorrect terminology but everybody uses it anyway" should, in most cases, be won by the technically-incorrect terminology. My favorite relevant examples of this are the fact that the Kelvin, not the degree Celsius, is the SI unit of temperature (yet 273.16 would be considered a fatally warm, rather than unpleasantly cold, day), and that the triple point of water is actually 0.01C, not 0C :)
Reply all
Reply to author
Forward
0 new messages