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

Dylan Baker baker.dylan.c at gmail.com
Fri Apr 1 00:04:47 UTC 2016


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()
-- 
2.8.0



More information about the mesa-dev mailing list