From 0b0ed85b1643b1a3a3e712301c086a63660316fa Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Thu, 15 Feb 2024 17:20:23 -0600 Subject: [PATCH] change isinstance(..., frozenset) to abc_Set, pt2 --- loopy/translation_unit.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/loopy/translation_unit.py b/loopy/translation_unit.py index af3ca452e..39fdb2275 100644 --- a/loopy/translation_unit.py +++ b/loopy/translation_unit.py @@ -23,6 +23,7 @@ """ import collections +from collections.abc import Set as abc_Set from dataclasses import field, dataclass, replace from typing import FrozenSet, Optional, TYPE_CHECKING, Mapping, Callable, Union, Any from warnings import warn @@ -195,7 +196,8 @@ class TranslationUnit: entrypoints: FrozenSet[str] def __post_init__(self): - assert isinstance(self.entrypoints, frozenset) + + assert isinstance(self.entrypoints, abc_Set) assert isinstance(self.callables_table, Map) object.__setattr__(self, "_program_executor_cache", {}) @@ -239,7 +241,7 @@ def with_entrypoints(self, entrypoints): entrypoints = frozenset([e.strip() for e in entrypoints.split(",")]) - assert isinstance(entrypoints, frozenset) + assert isinstance(entrypoints, abc_Set) return self.copy(entrypoints=entrypoints)