From a1f920a3cbd8e12ae4af53e56507653aa262738c Mon Sep 17 00:00:00 2001 From: Jack McCluskey Date: Thu, 2 Nov 2023 13:57:10 -0400 Subject: [PATCH] Merge subclass helper (linting) --- sdks/python/apache_beam/typehints/typehints.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sdks/python/apache_beam/typehints/typehints.py b/sdks/python/apache_beam/typehints/typehints.py index 2f031fee13cd..c7da528c0b4f 100644 --- a/sdks/python/apache_beam/typehints/typehints.py +++ b/sdks/python/apache_beam/typehints/typehints.py @@ -1037,8 +1037,11 @@ def __repr__(self): @staticmethod def _is_subclass_constraint(sub): - return isinstance(sub, CollectionTypeConstraint) or isinstance( - sub, SetTypeConstraint) or isinstance(sub, FrozenSetTypeConstraint) + return isinstance( + sub, ( + CollectionTypeConstraint, + FrozenSetTypeConstraint, + SetTypeConstraint)) def _consistent_with_check_(self, sub): if self._is_subclass_constraint(sub):