[Scons-users] CPPDEFINES Unexpected Behavior

Evan Driscoll driscoll at cs.wisc.edu
Thu Apr 11 18:54:08 EDT 2013


On 04/11/2013 03:27 PM, Dirk Bächle wrote:

> Rob,

>

> On 11.04.2013 21:35, Managan, Rob wrote:

>> Dirk,

>>

>> I don't think it is quite that simple. I agree with you for these two

>> cases:

>>

>> [...]

>> However,

>> env = Environment(CPPDEFINES={'def1':23, 'def2':None})

>> env.AppendUnique(CPPDEFINES=['def3=4'])

>>

>

> this is a contrived example indeed. I fail to see what would be the

> expected output of a list appended to a dict. And what should happen

> in the opposite case? Do we really want to support all these corner

> cases, or wouldn't a note in the docs help, telling the user to stay

> consistent and use all lists or all dicts only?


Just to reiterate my previous email: IMO, the mixed-type appending is a
red herring.


It is surprising to me that
env["CPPDEFINES"] = { key : value }
and
env["CPPDEFINES"] = [ (key, value) ]
produce the same answer in all cases *except* when value is None. (In
fact, I'm doubly surprised as I'd have expected a dictionary CPPDEFINES
to just be converted to a list in the implementation.)

Changing *that* behavior, which seems to me to be desirable anyway,
seems likely to fix Rob's behavior along the way as a side effect.
Though I also agree the mix of dicts and lists doesn't seem like a good
idea to me. :-)

Evan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20130411/377bf73a/attachment.html>


More information about the Scons-users mailing list