[Piglit] [PATCH 3/3] tests/all.py: Make MSAA_SAMPLE_COUNTS a list instead of a tuple

Ilia Mirkin imirkin at alum.mit.edu
Thu Dec 3 11:34:25 PST 2015


On Thu, Dec 3, 2015 at 2:31 PM, Dylan Baker <baker.dylan.c at gmail.com> wrote:
> On Thu, Dec 03, 2015 at 12:00:11AM -0500, Ilia Mirkin wrote:
>> On Wed, Dec 2, 2015 at 9:04 PM, Dylan Baker <dylanx.c.baker at intel.com> wrote:
>> > On Wed, Dec 02, 2015 at 06:13:48PM -0500, Ilia Mirkin wrote:
>> >> On Wed, Dec 2, 2015 at 5:36 PM,  <baker.dylan.c at gmail.com> wrote:
>> >> > From: Dylan Baker <baker.dylan.c at gmail.com>
>> >> >
>> >> > The problem with using MSAA_SAMPLE_COUNTS as a tuple is that it isn't a
>> >> > tuple. It's a sequence of like values, and is combined with other
>> >> > sequences of values, this is what a list is for.
>> >>
>> >> Huh? List = mutable, tuple = immutable. This seems immutable, so it
>> >> should be a tuple. What am I missing?
>> >
>> > I had a very lengthy response trying to explain why this should be a
>> > list not a tuple, but I think this does a better job of explaining my
>> > position:
>> > http://news.e-scribe.com/397
>>
>> So basically because you have some notion that some things should be
>> in lists and other things should be in tuples and the current
>> arrangement makes you feel icky? FWIW it makes me feel icky whenever I
>> see a list used for something that's immutable.
>>
>>   -ilia
>
> Tuples and lists and sets are all distinct, the fact that a tuple is
> immutable is an implementation detail of python, not something inherit
> to the concept of a tuple. Besides that, it's not really even immutable,
> we add '0' and 'all_samples' to the MSAA_SAMPLES_COUNTS collection
> multiple times.
>
> I guess the argument is purely academic, but I stand by my assertion
> that the data is homogeneous, it should be a list (or ideally perhaps
> the non-existent "frozenlist").

I look at it much more from an implementor's standpoint -- list has to
be in a datastructure that deals well with resizing, mutation, etc.
tuple does not. So I pick the datastructure that has a better chance
at being faster for my intended usage. But like you said, it's all
academic, and we've probably both spent more time on it than either of
us cared :)

  -ilia


More information about the Piglit mailing list