diff options
author | Carson Ip <carsonip715@gmail.com> | 2020-01-17 15:05:18 +0800 |
---|---|---|
committer | Jeff Widman <jeff@jeffwidman.com> | 2020-02-05 15:22:51 -0800 |
commit | d54aaf6a46dbd981a0bb08570d94b4d8c4c59aef (patch) | |
tree | 3dc8a269d3772487e665c21dbfcb93fa148894e8 /kafka/record/abc.py | |
parent | bb1c13e9d3ef609fc456b4b6fd4cc075bd100b1b (diff) | |
download | kafka-python-d54aaf6a46dbd981a0bb08570d94b4d8c4c59aef.tar.gz |
Fix slots usage and use more slots
Use empty slots for ABC classes, otherwise classes which inherit from
them will still have __dict__. Also use __slots__ for more classes.
Diffstat (limited to 'kafka/record/abc.py')
-rw-r--r-- | kafka/record/abc.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kafka/record/abc.py b/kafka/record/abc.py index 83121c6..d5c172a 100644 --- a/kafka/record/abc.py +++ b/kafka/record/abc.py @@ -4,6 +4,7 @@ import abc class ABCRecord(object): __metaclass__ = abc.ABCMeta + __slots__ = () @abc.abstractproperty def offset(self): @@ -45,6 +46,7 @@ class ABCRecord(object): class ABCRecordBatchBuilder(object): __metaclass__ = abc.ABCMeta + __slots__ = () @abc.abstractmethod def append(self, offset, timestamp, key, value, headers=None): @@ -87,6 +89,7 @@ class ABCRecordBatch(object): compressed) message. """ __metaclass__ = abc.ABCMeta + __slots__ = () @abc.abstractmethod def __iter__(self): @@ -97,6 +100,7 @@ class ABCRecordBatch(object): class ABCRecords(object): __metaclass__ = abc.ABCMeta + __slots__ = () @abc.abstractmethod def __init__(self, buffer): |