# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2010-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2010-2024 CEA, EDF, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
## \defgroup enumerate enumerate
-# \{
+# \{
# \details Emulates a C-like enum for python
# \}
# of strings to be used as the enum symbolic keys. The enum values are automatically
# generated as sequencing integer starting at the specified offset value.
# \ingroup enumerate
-class Enumerate(object):
+class Enumerate:
"""
This class emulates a C-like enum for python. It is initialized with a list
of strings to be used as the enum symbolic keys. The enum values are automatically
generated as sequencing integer starting at the specified offset value.
"""
-
+
## Canonical constructor.
# \param keys a list of string to be used as the enum symbolic keys. The enum values
# are automatically generated as a sequence of integers starting at the specified
return key in self._dict_keynumbers
## Returns true if the specified integer value is defined as an identifier
- # in this enumarate.
+ # in this enumerate.
# \param value a value to test
def isValid(self, value):
"""
Returns true if the specified integer value is defined as an identifier
- in this enumarate.
+ in this enumerate.
@value a value to test
"""
return value in self._dict_numberkeys