1- import abc
1+ from abc import ABC , abstractmethod
22from collections import OrderedDict
33from collections .abc import Sequence
44from enum import IntEnum
@@ -731,7 +731,7 @@ def complete_validation(self, validated_position=None):
731731 self ._position = validated_position
732732
733733
734- class ConsumerRebalanceListener (metaclass = abc . ABCMeta ):
734+ class ConsumerRebalanceListener (ABC ):
735735 """
736736 A callback interface that the user can implement to trigger custom actions
737737 when the set of partitions assigned to the consumer changes.
@@ -779,7 +779,7 @@ class ConsumerRebalanceListener(metaclass=abc.ABCMeta):
779779 taking over that partition has their on_partitions_assigned() callback
780780 called to load the state.
781781 """
782- @abc . abstractmethod
782+ @abstractmethod
783783 def on_partitions_revoked (self , revoked ):
784784 """
785785 A callback method the user can implement to provide handling of offset
@@ -801,7 +801,7 @@ def on_partitions_revoked(self, revoked):
801801 """
802802 pass
803803
804- @abc . abstractmethod
804+ @abstractmethod
805805 def on_partitions_assigned (self , assigned ):
806806 """
807807 A callback method the user can implement to provide handling of
@@ -840,7 +840,7 @@ def on_partitions_lost(self, lost):
840840 return self .on_partitions_revoked (lost )
841841
842842
843- class AsyncConsumerRebalanceListener (metaclass = abc . ABCMeta ):
843+ class AsyncConsumerRebalanceListener (ABC ):
844844 """
845845 Async variant of :class:`ConsumerRebalanceListener`.
846846
@@ -856,7 +856,7 @@ class AsyncConsumerRebalanceListener(metaclass=abc.ABCMeta):
856856 invokes ``on_partitions_assigned``. Both methods must be defined as
857857 ``async def``; otherwise use :class:`ConsumerRebalanceListener`.
858858 """
859- @abc . abstractmethod
859+ @abstractmethod
860860 async def on_partitions_revoked (self , revoked ):
861861 """Async-callback for the start of a rebalance operation.
862862
@@ -870,7 +870,7 @@ async def on_partitions_revoked(self, revoked):
870870 """
871871 pass
872872
873- @abc . abstractmethod
873+ @abstractmethod
874874 async def on_partitions_assigned (self , assigned ):
875875 """Async-callback for the completion of a partition re-assignment.
876876
0 commit comments