[Scons-users] Is this a feature or a bug…
William Deegan
bill at baddogconsulting.com
Tue Aug 21 15:14:48 EDT 2012
On 08/21/2012 08:40 AM, Chris BeHanna wrote:
> 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.
>
Likely the third argument should allow any iterable.
So it could be a generator even.
The contents of a single element would be what you'd then have to check
to see if they matched what was expected. (To address your [(aaa,bbb)]
above.)
-Bill
More information about the Scons-users
mailing list