Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use binary prefixes #61395

Closed
serhiy-storchaka opened this issue Feb 12, 2013 · 13 comments
Closed

Use binary prefixes #61395

serhiy-storchaka opened this issue Feb 12, 2013 · 13 comments
Assignees
Labels
docs Documentation in the Doc dir easy type-feature A feature request or enhancement

Comments

@serhiy-storchaka
Copy link
Member

BPO 17193
Nosy @brettcannon, @terryjreedy, @ezio-melotti, @serhiy-storchaka
Files
  • binary_prefixes.patch
  • binary_prefixes_2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2013-02-16.15:34:01.248>
    created_at = <Date 2013-02-12.14:54:56.894>
    labels = ['easy', 'type-feature', 'docs']
    title = 'Use binary prefixes'
    updated_at = <Date 2013-02-16.15:34:01.246>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2013-02-16.15:34:01.246>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2013-02-16.15:34:01.248>
    closer = 'serhiy.storchaka'
    components = ['Documentation']
    creation = <Date 2013-02-12.14:54:56.894>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['29049', '29052']
    hgrepos = []
    issue_num = 17193
    keywords = ['patch', 'easy']
    message_count = 13.0
    messages = ['181961', '181964', '181966', '181968', '181974', '181975', '182019', '182042', '182049', '182176', '182186', '182228', '182229']
    nosy_count = 6.0
    nosy_names = ['brett.cannon', 'terry.reedy', 'ezio.melotti', 'docs@python', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue17193'
    versions = ['Python 3.3', 'Python 3.4']

    @serhiy-storchaka
    Copy link
    Member Author

    Starting around 1998, a number of standards and trade organizations approved standards and recommendations for a new set of binary prefixes that would refer unambiguously to powers of 1024. According to these, the SI prefixes would only be used in the decimal sense, even when referring to data storage capacities: kilobyte and megabyte would denote one thousand bytes and one million bytes respectively (consistent with SI), while new terms such as kibibyte, mebibyte and gibibyte, abbreviated KiB, MiB, and GiB, would denote 1024 bytes, 1048576 bytes, and 1073741824 bytes respectively.[1]

    The proposed patch replaces old terms such as kB or KBytes by new terms such as KiB.

    [1] http://en.wikipedia.org/wiki/Binary_prefix

    @serhiy-storchaka serhiy-storchaka added docs Documentation in the Doc dir easy type-feature A feature request or enhancement labels Feb 12, 2013
    @brettcannon
    Copy link
    Member

    Patch looks good except for the consistent lack of space between number and unit, e.g. "5MiB" instead of "5 MiB". Is there a reason for this?

    @serhiy-storchaka
    Copy link
    Member Author

    Yes, there is a little reason. It looks ugly if a line broken between number and unit (this is possible if we use space). A non-breakable space is better, but it seems that there is no easy way to specify it in ReST. I will be glad to be wrong.

    @brettcannon
    Copy link
    Member

    It might be ugly but it's also incorrect formatting to leave the space out. =) And I think it makes it harder to actually read the number.

    If you really want to avoid the breaking you can use the tip at http://stackoverflow.com/questions/11830242/non-breaking-space or the Unicode \xa0 literal.

    @serhiy-storchaka
    Copy link
    Member Author

    Yes I have seen these tips and they look complicated enough. Here is an updated patch with spaces between numbers and units.

    @brettcannon
    Copy link
    Member

    LGTM

    @serhiy-storchaka
    Copy link
    Member Author

    For what versions can I apply this patch?

    @brettcannon
    Copy link
    Member

    IMO I say just do 3.4 since it isn't really a bug fix but a cleanup, but I wouldn't object if it was backported.

    @serhiy-storchaka
    Copy link
    Member Author

    Then I'll apply this to 3.3 too. This will facilitate support of both versions.

    @ezio-melotti
    Copy link
    Member

    +1

    I left some comments on Rietveld.
    The SI standard says that there should be a space between the value and the unit, and I agree that while a no-break space would be better, a regular space is still better than no space at all.
    Applying this on 3.3 and default is fine too.

    @terryjreedy
    Copy link
    Member

    I agree that we should contribute to ending the confusion. Searching KiB, MiB, GiB (with Google) gives a Wikipedia article as first or second hit, so the meanings of the abbreviations and terms are easily discoverable.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Feb 16, 2013

    New changeset c1f846a99c85 by Serhiy Storchaka in branch '3.3':
    Issue bpo-17193: Use binary prefixes (KiB, MiB, GiB) for memory units.
    http://hg.python.org/cpython/rev/c1f846a99c85

    New changeset 73a16d3c066a by Serhiy Storchaka in branch 'default':
    Issue bpo-17193: Use binary prefixes (KiB, MiB, GiB) for memory units.
    http://hg.python.org/cpython/rev/73a16d3c066a

    @serhiy-storchaka
    Copy link
    Member Author

    Thank you, Ezio, for your comments.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir easy type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants