File tree Expand file tree Collapse file tree
src/confluent_kafka/_model Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- from enum import Enum , IntEnum
15+ from enum import Enum
1616from typing import List , Optional
1717
1818from .. import cimpl
@@ -195,12 +195,13 @@ def __lt__(self, other: object) -> bool:
195195 return self .value < other .value
196196
197197
198- class AcknowledgeType (IntEnum ):
198+ class AcknowledgeType (Enum ):
199199 """
200- Share Consumer acknowledgement type.
201-
202- Used to tell the broker how to
200+ Share Consumer acknowledgement type — used to tell the broker how to
203201 handle a polled message in explicit acknowledgement mode.
202+
203+ Values:
204+ -------
204205 """
205206
206207 #: Record was processed successfully — broker will not redeliver it.
@@ -209,3 +210,8 @@ class AcknowledgeType(IntEnum):
209210 RELEASE = 2
210211 #: Permanently failed — do NOT redeliver (poison pill).
211212 REJECT = 3
213+
214+ def __index__ (self ) -> int :
215+ # Allow passing AcknowledgeType.ACCEPT directly where an int is
216+ # expected (e.g., PyArg_ParseTupleAndKeywords "i" format).
217+ return self .value
You can’t perform that action at this time.
0 commit comments