Repository navigation
fix: emit the yotta (Y) unit in bytes2human - #459
Closed
nikolauspschuetz wants to merge 1 commit into
Closed
nikolauspschuetz wants to merge 1 commit into
nikolauspschuetz wants to merge 1 commit into
Conversation
_SIZE_RANGES zipped the size bounds with their successors, so the loop symbol only ranged over B..Z and the largest unit "Y" was never emitted; yotta-scale values overflowed into Z (e.g. bytes2human(1024**8) returned '1024Z' instead of '1Y'). Pair the last bound with an infinite sentinel so the Y range is reached, and add a doctest.
mahmoud
added a commit
that referenced
this pull request
Sep 7, 2026
Fold #463, #466, #476, #478, #460, #459, and #477 with focused regressions and 26.2.0 release notes. Verified 672 local tests and the full GitHub Actions matrix before merge. Co-authored-by: Ali Zulfiqar <codewithfourtix@gmail.com> Co-authored-by: Guo Jiarui <799423879@qq.com> Co-authored-by: Nikolaus Schuetz <nikolauspschuetz@gmail.com> Co-authored-by: Raiyan Zaman <77029110+rzaman8677@users.noreply.github.com>
Owner
|
Folded into #481 with credit (Co-authored-by). Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bytes2humannever emitted the largest unitY(yotta):_SIZE_RANGESzips the size bounds with their successors, so the loop'ssymbolonly ranges overB…Z, and yotta-scale values overflow intoZ—bytes2human(1024**8)returned'1024Z'instead of'1Y'.Pairs the last bound with an
(inf, '')sentinel so theYrange is reachable, and adds a doctest.Verified:
bytes2human(1024**8) == '1Y'(and5Y),Zstill correct, allstrutilsdoctests pass.Developed with AI assistance (Claude Code); I directed, reviewed, and verified it locally.