Commands: init'ing booleans to None
There are a bunch of places in distutils.command where Boolean options are initialized to None; there are other places where they're initialized to zero. Is it worth making this consistent, and always setting them to 0? (I'm currently going through all the commands checking the boolean_opts class variables, so I can change the initializations at the same time.) --amk (www.amk.ca) "But as the papers say, he's caught the public's imagination." "Didn't know they had any." -- Cops, in ENIGMA #2: "The Truth"
On Thu, 21 Mar 2002, Andrew Kuchling wrote:
There are a bunch of places in distutils.command where Boolean options are initialized to None; there are other places where they're initialized to zero. Is it worth making this consistent, and always setting them to 0? (I'm currently going through all the commands checking the boolean_opts class variables, so I can change the initializations at the same time.)
I think you should be extra careful here as some Boolean options seem to be initialized to None and not to 0 in purpose. See for example the `compile' option in install_lib command. If `compile is None', then it is interpreted as "user has not explicitly disabled or enabled compile flag" and then it is set to default value `compile = 1'. So, `None' is not always `0', `None' means "use default" and default may be either 0 or 1. How can you test that your changes will not introduce curious and hard to find bugs? Because there are non-trivial derivatives of distutils (like scipy_distutils) that may also depend on the current behavior of distutils where `None' does not necessarily mean `0'. Regards, Pearu
On Fri, Mar 22, 2002 at 09:57:51AM +0200, Pearu Peterson wrote:
So, `None' is not always `0', `None' means "use default" and default may be either 0 or 1.
Ah, right; grepping through install_*.py finds such case. Never mind, then; I've reverted the one such change I already made. Thanks for catching this, Pearu! --amk (www.amk.ca) It will be good to be dead - to be a god. -- The emperor Augustus in SANDMAN #30: "August"
participants (2)
-
Andrew Kuchling
-
Pearu Peterson