Giter Club home page Giter Club logo

Comments (2)

johnyf avatar johnyf commented on June 8, 2024

Above (#77 (comment)), the conclusion was to, among other changes, rename the constants dd.cudd.GB and dd.cudd_zdd.GB to dd.cudd.GiB and dd.cudd_zdd.GiB, respectively (and to remove the unused constant dd.sylvan.GB).

Previously, in each of these two modules, the constant GB was used at two places, and only internally to dd (the constant could have been hidden as _GB). However, the changes described above would result in the constant GiB being used at only one place (and still only internally to dd): just to define another constant, on the line after the line that would define GiB. So the constant GiB would be redundant ("Simple is better than complex." PEP 20).

Therefore, the constant GB will be removed from these modules, and no replacement constant (like GiB was intended to be) added. Instead, the number 2**30 will replace the use of GB on the line this occurs. A comment will mention "GiB" and the relevant standard, in order to emphasize that the chosen number (2**30) is a binary multiple. This removes entirely from dd the presence of any convention on naming multiples: the numbers themselves are used directly.

Also, several of the concerns and alternatives discussed regarding the renaming are not relevant or applicable after this decision, so it becomes obvious what the new design will be.

Aside: A module variable that is intended to be used as a constant is usually named with all uppercase letters and underscores, according to PEP 8. So the choice of identifier GiB above would not have been entirely incompatible with PEP 8, though it is not recommended (nevertheless, this naming case concerns a standardized unit name, so preserving the letter case seems the best choice). In any case, the decision to remove the constant as unnecessary also avoids this naming conundrum.

from dd.

johnyf avatar johnyf commented on June 8, 2024

Addressed in commits cc8a609, e248d95, a1dbbd6, and 4f488a3.

from dd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.