2022-12-31 17:33:20 +00:00
|
|
|
class AbstractSerializer:
|
2022-02-13 10:56:44 +00:00
|
|
|
"""
|
|
|
|
This class describes an abstract serializer.
|
|
|
|
"""
|
|
|
|
|
2022-10-05 14:43:46 +00:00
|
|
|
def __init__(self, extensions=None):
|
2022-12-31 17:33:20 +00:00
|
|
|
super().__init__()
|
2022-10-05 14:43:46 +00:00
|
|
|
self._extensions = (extensions or []).copy()
|
2020-01-20 15:19:53 +00:00
|
|
|
|
2020-02-20 16:14:48 +00:00
|
|
|
def decode(self, s, **kwargs):
|
2020-02-03 17:25:54 +00:00
|
|
|
raise NotImplementedError()
|
2020-01-20 15:19:53 +00:00
|
|
|
|
2020-02-20 16:14:48 +00:00
|
|
|
def encode(self, d, **kwargs):
|
2020-02-03 17:25:54 +00:00
|
|
|
raise NotImplementedError()
|
2022-10-05 14:43:46 +00:00
|
|
|
|
|
|
|
def extensions(self):
|
|
|
|
return self._extensions.copy()
|