From be2ea19cce3adf5b81f9d43736bc58813faa3774 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Tue, 1 Mar 2022 10:41:21 -0600
Subject: [PATCH] Add _with_new_tags to LoopKernel, ArrayBase, Iname

---
 doc/misc.rst             | 9 ---------
 loopy/kernel/__init__.py | 3 +++
 loopy/kernel/array.py    | 3 +++
 loopy/kernel/data.py     | 3 +++
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/doc/misc.rst b/doc/misc.rst
index cd3d20501..8a03589fd 100644
--- a/doc/misc.rst
+++ b/doc/misc.rst
@@ -486,12 +486,3 @@ Cross-References to Other Documentation
 .. class:: complex128
 
     See :class:`numpy.generic`.
-
-Type Variables
---------------
-
-.. currentmodule:: loopy
-
-.. class:: T_co
-
-    A covariant type variable used in, e.g. :meth:`pytools.tag.Taggable.copy`.
diff --git a/loopy/kernel/__init__.py b/loopy/kernel/__init__.py
index 7425f0d3f..8ddf3bf17 100644
--- a/loopy/kernel/__init__.py
+++ b/loopy/kernel/__init__.py
@@ -1659,6 +1659,9 @@ class LoopKernel(ImmutableRecordWithoutPickling, Taggable):
 
         return super().copy(**kwargs)
 
+    def _with_new_tags(self, tags):
+        return self.copy(tags=tags)
+
 # }}}
 
 # vim: foldmethod=marker
diff --git a/loopy/kernel/array.py b/loopy/kernel/array.py
index b6ed5518d..bffdd84ec 100644
--- a/loopy/kernel/array.py
+++ b/loopy/kernel/array.py
@@ -924,6 +924,9 @@ class ArrayBase(ImmutableRecord, Taggable):
     def __ne__(self, other):
         return not self.__eq__(other)
 
+    def _with_new_tags(self, tags):
+        return self.copy(tags=tags)
+
     def stringify(self, include_typename):
         import loopy as lp
 
diff --git a/loopy/kernel/data.py b/loopy/kernel/data.py
index b8194e107..f2c642037 100644
--- a/loopy/kernel/data.py
+++ b/loopy/kernel/data.py
@@ -929,6 +929,9 @@ class Iname(Taggable):
 
         return type(self)(name=name, tags=tags)
 
+    def _with_new_tags(self, tags):
+        return self.copy(tags=tags)
+
     def update_persistent_hash(self, key_hash, key_builder):
         """Custom hash computation function for use with
         :class:`pytools.persistent_dict.PersistentDict`.
-- 
GitLab