Skip to content

Commit

Permalink
Fix MetaEnum docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
runame committed Sep 17, 2024
1 parent d60c876 commit b309300
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions curvlinops/kfac.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,15 @@
class MetaEnum(EnumMeta):
"""Metaclass for the Enum class for desired behavior of the `in` operator."""

def __contains__(cls, item):
"""Check if an item is a valid member of the Enum."""
def __contains__(cls, item: str) -> bool:
"""Check if an item is a valid member of the Enum.
Args:
item: The item to check.
Returns:
``True`` if the item is a valid member of the Enum, ``False`` otherwise.
"""
try:
cls(item)
except ValueError:
Expand Down

0 comments on commit b309300

Please sign in to comment.