Skip to content

Commit

Permalink
Fix mypy with flag comparison change
Browse files Browse the repository at this point in the history
MyPy seems to narrow types somehow when comparing Enum Flags
directly with equality operators. Compare by value instead.
  • Loading branch information
natelust committed Jun 30, 2023
1 parent fbf00cb commit 5432818
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/lsst/daf/butler/_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5432818

Please sign in to comment.