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):