-
Notifications
You must be signed in to change notification settings - Fork 45
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
sizes incorrectly parsed as powers of two by default, ignoring IEEE 1541 #4
Comments
Hi @anarcat and thanks for the feedback. You are technically 100% correct and to be honest I'm not worried about complicating the parsing, however changing this now would break backwards compatibility and I'm quite religious about that :-). There's also the question of doing what is technically correct versus the DWIM aspect. The least I can do is clearly document the caveat you've pointed out, but I won't change the implementation as suggested. What I can do is provide a second implementation that provides the parsing you suggest (it could be a keyword argument that has to be given to the |
maybe having a |
I have to say I was discussing with another developer about using this module for our application but we were astonished to find it that it is defaulting to base 2 yet using the SI base 10 prefix, making it unusable. Your coding standards and documentation seems quite meticulous but this is quite a glaring issue regarding unit prefix standards and continuing the confusion for end users. |
@xolox: I'm totally agreeing on providing some sort of backwards compatibility. Let's keep in mind, that even Windows does it wrong. Providing a second function to get true binary sizes would be great. |
On 2016-05-04 16:53:24, Manuel Leonhardt wrote:
"Windows does it wrong" should never be an argument against doing the Otherwise everything would always be wrong and we would see no Being cynical is the only way to deal with modern civilization — you |
Any chance of this happening? It should be possible to maintain backwards compatibility of the interface with something like this, shouldn't it?
|
I created a pull request making it clearer in the documentation which units are used: #9 |
Hi everyone, sorry for taking so long to respond but thanks to everyone who chimed in! Reading through #4, #8 and #9 have convinced me to change The logic in Because these changes are backwards incompatible I bumped the major version number to I hope the new implementation satisfies everyone's concerns! Feedback is welcome. |
thank you so much for doing the right thing! i haven't reviewed the actual implementation in details, but the logic is what i believe is the correct way. thanks again! |
i believe this is incorrect:
It should rather be:
i know it will complicate parsing because you can't assume that the first letter is enough to tell them apart, but maybe check the two first letters? :)
see https://en.wikipedia.org/wiki/Kibibyte for more details.
The text was updated successfully, but these errors were encountered: