mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-30 23:09:44 +00:00
fix docstrings
This commit is contained in:
parent
173ff0b235
commit
655b521749
@ -14,22 +14,29 @@ import hyperframe
|
||||
@six.add_metaclass(ABCMeta)
|
||||
class Serializable(object):
|
||||
"""
|
||||
ABC for Python's pickle protocol __getstate__ and __setstate__.
|
||||
Abstract Base Class that defines an API to save an object's state and restore it later on.
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def from_state(cls, state):
|
||||
obj = cls.__new__(cls)
|
||||
obj.__setstate__(state)
|
||||
return obj
|
||||
"""
|
||||
Create a new object from the given state.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
@abstractmethod
|
||||
def get_state(self):
|
||||
"""
|
||||
Retrieve object state.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
@abstractmethod
|
||||
def set_state(self, state):
|
||||
"""
|
||||
Set object state to the given state.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user