[Mesa-dev] [PATCH 30/41] glapi: gl_XML.py: return a tuple from gl_parameter.get_dimensions

Ian Romanick idr at freedesktop.org
Tue Apr 19 23:29:18 UTC 2016


I never really was clear on when to use which kind of thing.  This patch is

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 03/31/2016 05:04 PM, Dylan Baker wrote:
> rather than a list.
> 
> In python tuples are mainly for heterogenous collections, especially
> when position has relevance. Which makes them the right type for the
> job.
> 
> Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> ---
>  src/mapi/glapi/gen/gl_XML.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
> index 561a86f..9f24e56 100644
> --- a/src/mapi/glapi/gen/gl_XML.py
> +++ b/src/mapi/glapi/gen/gl_XML.py
> @@ -492,7 +492,7 @@ class gl_parameter(object):
>  
>      def get_dimensions(self):
>          if not self.width:
> -            return [0, "0", "0", "0", "0"]
> +            return (0, "0", "0", "0", "0")
>  
>          dim = 1
>          w = self.width
> @@ -512,7 +512,7 @@ class gl_parameter(object):
>              dim = 4
>              e = self.extent
>  
> -        return [dim, w, h, d, e]
> +        return (dim, w, h, d, e)
>  
>      def get_stack_size(self):
>          return self.type_expr.get_stack_size()
> 



More information about the mesa-dev mailing list