[Scons-users] Is this a feature or a bug…

Chris BeHanna chris at behanna.org
Tue Aug 21 11:40:01 EDT 2012


On Aug 21, 2012, at 10:04 , Gary Oberbrunner <garyo at oberbrunner.com> wrote:


> On Tue, Aug 21, 2012 at 10:44 AM, Russel Winder <russel at winder.org.uk> wrote:

>> Just asking the question prior to putting in a bug report, just in case

>> I have missed something…

>>

>> Command(XXX, YYY, [AAA, BBB])

>>

>> i.e. the action sequence is a list, works fine. However,

>>

>> Command(XXX, YYY, (AAA, BBB))

>>

>> is reported as an error, i.e. a tuple is not acceptable where a list is.

>>

>> To say this doesn't violate the Principle of Least Surprise would be to

>> violate the Principle of Least Surprise.

>

> I can't see any particular reason we shouldn't support tuples as well

> as lists there, although actually doing it might be complicated.


A tuple, strictly speaking, is not *exactly* the same as a list in python. What you might have happen is this:

Command(XXX, YYY, (AAA, BBB))

gets translated by layers below as

Command(XXX, YYY, [(AAA,BBB)])

i.e., that tuple becomes a singleton dictionary with a single key-value pair, rather than a list with two elements.

Thus, I would disagree, looking at it from a strictly "pythonic" view, that it violates POLA. I would actually expect it not to work properly.

--
Chris BeHanna
chris at behanna.org


More information about the Scons-users mailing list