On this page
enum.EnumCheck
Prev: enum.Enum | Up: enum | Next: enum.EnumDict
Rel: enum.auto, enum.Enum, enum.EnumDict, enum.EnumMeta
Ref: docs.python.org — enum.EnumCheck
Tags: #public #python3 #stdlib #enum
Import
import enum
from enum import EnumCheck
Signature & Overview
enum.EnumCheck(*values)
various conditions to check an enumeration for
Methods & Attributes
EnumCheck.capitalize(self, /)— Return a capitalized version of the string.EnumCheck.casefold(self, /)— Return a version of the string suitable for caseless comparisons.EnumCheck.center(self, width, fillchar=' ', /)— Return a centered string of length width.EnumCheck.count(...)— Return the number of non-overlapping occurrences of substring sub in string S[start:end].EnumCheck.encode(self, /, encoding='utf-8', errors='strict')— Encode the string using the codec registered for encoding.EnumCheck.endswith(...)— Return True if the string ends with the specified suffix, False otherwise.EnumCheck.expandtabs(self, /, tabsize=8)— Return a copy where all tab characters are expanded using spaces.EnumCheck.find(...)— Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].EnumCheck.format(self, /, *args, **kwargs)— Return a formatted version of the string, using substitutions from args and kwargs.EnumCheck.format_map(self, mapping, /)— Return a formatted version of the string, using substitutions from mapping.EnumCheck.index(...)— Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].EnumCheck.isalnum(self, /)— Return True if the string is an alpha-numeric string, False otherwise.EnumCheck.isalpha(self, /)— Return True if the string is an alphabetic string, False otherwise.EnumCheck.isascii(self, /)— Return True if all characters in the string are ASCII, False otherwise.EnumCheck.isdecimal(self, /)— Return True if the string is a decimal string, False otherwise.EnumCheck.isdigit(self, /)— Return True if the string is a digit string, False otherwise.EnumCheck.isidentifier(self, /)— Return True if the string is a valid Python identifier, False otherwise.EnumCheck.islower(self, /)— Return True if the string is a lowercase string, False otherwise.EnumCheck.isnumeric(self, /)— Return True if the string is a numeric string, False otherwise.EnumCheck.isprintable(self, /)— Return True if all characters in the string are printable, False otherwise.EnumCheck.isspace(self, /)— Return True if the string is a whitespace string, False otherwise.EnumCheck.istitle(self, /)— Return True if the string is a title-cased string, False otherwise.EnumCheck.isupper(self, /)— Return True if the string is an uppercase string, False otherwise.EnumCheck.join(self, iterable, /)— Concatenate any number of strings.EnumCheck.ljust(self, width, fillchar=' ', /)— Return a left-justified string of length width.EnumCheck.lower(self, /)— Return a copy of the string converted to lowercase.EnumCheck.lstrip(self, chars=None, /)— Return a copy of the string with leading whitespace removed.EnumCheck.maketrans(...)— Return a translation table usable for str.translate().EnumCheck.partition(self, sep, /)— Partition the string into three parts using the given separator.EnumCheck.removeprefix(self, prefix, /)— Return a str with the given prefix string removed if present.EnumCheck.removesuffix(self, suffix, /)— Return a str with the given suffix string removed if present.EnumCheck.replace(self, old, new, /, count=-1)— Return a copy with all occurrences of substring old replaced by new.EnumCheck.rfind(...)— Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].EnumCheck.rindex(...)— Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].EnumCheck.rjust(self, width, fillchar=' ', /)— Return a right-justified string of length width.EnumCheck.rpartition(self, sep, /)— Partition the string into three parts using the given separator.EnumCheck.rsplit(self, /, sep=None, maxsplit=-1)— Return a list of the substrings in the string, using sep as the separator string.EnumCheck.rstrip(self, chars=None, /)— Return a copy of the string with trailing whitespace removed.EnumCheck.split(self, /, sep=None, maxsplit=-1)— Return a list of the substrings in the string, using sep as the separator string.EnumCheck.splitlines(self, /, keepends=False)— Return a list of the lines in the string, breaking at line boundaries.
Usage
from enum import Enum, EnumCheck, verify
@verify(EnumCheck.UNIQUE, EnumCheck.CONTINUOUS)
class Step(Enum):
ONE = 1
TWO = 2
THREE = 3
assert len(Step) == 3
Gotchas
- Requires Python 3.11+: Provides
CONTINUOUS,NAMED_FLAGS, andUNIQUEchecks for@enum.verify(...).
REPL Inspect
from enum import EnumCheck
help(EnumCheck)
Linked from
- tuts/python3/stdlib_module/enum
- tuts/python3/stdlib_module/enum/auto
- tuts/python3/stdlib_module/enum/Enum
- tuts/python3/stdlib_module/enum/EnumDict
- tuts/python3/stdlib_module/enum/EnumMeta
- tuts/python3/stdlib_module/enum/EnumType
- tuts/python3/stdlib_module/enum/Flag
- tuts/python3/stdlib_module/enum/FlagBoundary
- tuts/python3/stdlib_module/enum/global_enum
- tuts/python3/stdlib_module/enum/global_enum_repr
- tuts/python3/stdlib_module/enum/global_flag_repr
- tuts/python3/stdlib_module/enum/global_str
- tuts/python3/stdlib_module/enum/IntEnum
- tuts/python3/stdlib_module/enum/IntFlag
- tuts/python3/stdlib_module/enum/member
- tuts/python3/stdlib_module/enum/nonmember
- tuts/python3/stdlib_module/enum/pickle_by_enum_name
- tuts/python3/stdlib_module/enum/pickle_by_global_name
- tuts/python3/stdlib_module/enum/property
- tuts/python3/stdlib_module/enum/ReprEnum
- tuts/python3/stdlib_module/enum/StrEnum
- tuts/python3/stdlib_module/enum/unique
- tuts/python3/stdlib_module/enum/verify
Related notes
- tuts/python3/stdlib_module/enum/auto Linked here; links to this page; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/Enum Linked here; links to this page; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/EnumDict Linked here; links to this page; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/EnumMeta Linked here; links to this page; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/EnumType links to this page; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/Flag links to this page; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/FlagBoundary links to this page; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/global_enum links to this page; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/global_enum_repr links to this page; shared tags: #enum, #stdlib
- tuts/python3/stdlib_module/enum/global_flag_repr links to this page; shared tags: #enum, #stdlib