python-benedict/benedict/serializers/abstract.py

18 lines
423 B
Python
Raw Normal View History

class AbstractSerializer:
2022-02-13 10:56:44 +00:00
"""
This class describes an abstract serializer.
"""
def __init__(self, extensions=None):
super().__init__()
self._extensions = (extensions or []).copy()
def decode(self, s, **kwargs):
raise NotImplementedError()
def encode(self, d, **kwargs):
raise NotImplementedError()
def extensions(self):
return self._extensions.copy()