From 3019cac55017b145856c52de3177a134a83799c8 Mon Sep 17 00:00:00 2001
From: Jonathan Mackenzie <jonmac1@gmail.com>
Date: Mon, 27 Mar 2017 13:52:56 +1030
Subject: [PATCH] Added deprecation warning for pyopencl.array.vec usage

---
 pyopencl/array.py | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/pyopencl/array.py b/pyopencl/array.py
index f5ad2ff7..ac32eede 100644
--- a/pyopencl/array.py
+++ b/pyopencl/array.py
@@ -61,7 +61,16 @@ except:
     def _dtype_is_object(t):
         return False
 
-vec = cltypes
+
+class VecLookupWarner(object):
+    def __getattr__(self, name):
+        from warnings import warn
+        warn("pyopencl.array.vec is deprecated. "
+             "Please use pyopencl.cltypes for OpenCL vector and scalar types",
+             DeprecationWarning, 2)
+        return getattr(cltypes, name)
+
+vec = VecLookupWarner()
 
 # {{{ helper functionality
 
-- 
GitLab