From 5432818de46e08eece5a47baac6ce05f31bf3d38 Mon Sep 17 00:00:00 2001 From: Nate Lust Date: Fri, 30 Jun 2023 11:30:01 -0400 Subject: [PATCH] Fix mypy with flag comparison change MyPy seems to narrow types somehow when comparing Enum Flags directly with equality operators. Compare by value instead. --- python/lsst/daf/butler/_butler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/lsst/daf/butler/_butler.py b/python/lsst/daf/butler/_butler.py index 9b9fe8d8a3..0005af9375 100644 --- a/python/lsst/daf/butler/_butler.py +++ b/python/lsst/daf/butler/_butler.py @@ -1651,9 +1651,9 @@ def exists( if full_check: if self.datastore.exists(ref): existence |= DatasetExistence._ARTIFACT - elif existence != DatasetExistence.UNRECOGNIZED: + elif existence.value != DatasetExistence.UNRECOGNIZED.value: # Do not add this flag if we have no other idea about a dataset. - existence |= DatasetExistence._ASSUMED + existence |= DatasetExistence(DatasetExistence._ASSUMED) return existence