diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-01-13 08:49:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-13 13:49:28 +0000 |
commit | 10a88ba91cb16ccf757984f0a7d41ddf8b4dc07f (patch) | |
tree | 1b97b98f60f33e690e9dcc4156ebafdd2617fe26 /synapse/events | |
parent | Fix typo in demo docs: differnt (#11735) (diff) | |
download | synapse-10a88ba91cb16ccf757984f0a7d41ddf8b4dc07f.tar.xz |
Use auto_attribs/native type hints for attrs classes. (#11692)
Diffstat (limited to 'synapse/events')
-rw-r--r-- | synapse/events/snapshot.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/synapse/events/snapshot.py b/synapse/events/snapshot.py index f251402ed8..0eab1aefd6 100644 --- a/synapse/events/snapshot.py +++ b/synapse/events/snapshot.py @@ -28,7 +28,7 @@ if TYPE_CHECKING: from synapse.storage.databases.main import DataStore -@attr.s(slots=True) +@attr.s(slots=True, auto_attribs=True) class EventContext: """ Holds information relevant to persisting an event @@ -103,15 +103,15 @@ class EventContext: accessed via get_prev_state_ids. """ - rejected = attr.ib(default=False, type=Union[bool, str]) - _state_group = attr.ib(default=None, type=Optional[int]) - state_group_before_event = attr.ib(default=None, type=Optional[int]) - prev_group = attr.ib(default=None, type=Optional[int]) - delta_ids = attr.ib(default=None, type=Optional[StateMap[str]]) - app_service = attr.ib(default=None, type=Optional[ApplicationService]) + rejected: Union[bool, str] = False + _state_group: Optional[int] = None + state_group_before_event: Optional[int] = None + prev_group: Optional[int] = None + delta_ids: Optional[StateMap[str]] = None + app_service: Optional[ApplicationService] = None - _current_state_ids = attr.ib(default=None, type=Optional[StateMap[str]]) - _prev_state_ids = attr.ib(default=None, type=Optional[StateMap[str]]) + _current_state_ids: Optional[StateMap[str]] = None + _prev_state_ids: Optional[StateMap[str]] = None @staticmethod def with_state( |