From 0b49c917d241e7dbe3295d84caa80136bf14d93a Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Mon, 12 Feb 2024 14:18:32 -0600 Subject: [PATCH] change isinstance(..., frozenset) to isinstance(..., abc.Set) --- loopy/kernel/instruction.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/loopy/kernel/instruction.py b/loopy/kernel/instruction.py index 5c28247ad..ed18e2ba4 100644 --- a/loopy/kernel/instruction.py +++ b/loopy/kernel/instruction.py @@ -31,6 +31,7 @@ from loopy.diagnostic import LoopyError from loopy.tools import Optional +from collections.abc import Set as abc_Set # {{{ instruction tags @@ -186,7 +187,7 @@ class InstructionBase(ImmutableRecord, Taggable): A :class:`frozenset` of subclasses of :class:`pytools.tag.Tag` used to provide metadata on this object. Legacy string tags are converted to :class:`LegacyStringInstructionTag` or, if they used to carry - a functional meaning, the tag carrying that same fucntional meaning + a functional meaning, the tag carrying that same functional meaning (e.g. :class:`UseStreamingStoreTag`). .. automethod:: __init__ @@ -267,7 +268,7 @@ def __init__(self, id, depends_on, depends_on_is_final, if depends_on_is_final is None: depends_on_is_final = False - if depends_on_is_final and not isinstance(depends_on, frozenset): + if depends_on_is_final and not isinstance(depends_on, abc_Set): raise LoopyError("Setting depends_on_is_final to True requires " "actually specifying depends_on") @@ -277,7 +278,7 @@ def __init__(self, id, depends_on, depends_on_is_final, if priority is None: priority = 0 - if not isinstance(tags, frozenset): + if not isinstance(tags, abc_Set): # was previously allowed to be tuple tags = frozenset(tags) @@ -292,10 +293,10 @@ def __init__(self, id, depends_on, depends_on_is_final, # assert all(is_interned(iname) for iname in within_inames) # assert all(is_interned(pred) for pred in predicates) - assert isinstance(within_inames, frozenset) - assert isinstance(depends_on, frozenset) or depends_on is None - assert isinstance(groups, frozenset) - assert isinstance(conflicts_with_groups, frozenset) + assert isinstance(within_inames, abc_Set) + assert isinstance(depends_on, abc_Set) or depends_on is None + assert isinstance(groups, abc_Set) + assert isinstance(conflicts_with_groups, abc_Set) ImmutableRecord.__init__(self, id=id,