-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
self.prev_state_events = [] | ||
self.rejected = False | ||
self.app_service = None | ||
state_group = attr.ib(default=None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a note: you can annotate the types in this with type=
-- for the optional ones you want to use typing.Optional[int]
or whatever. mypy can read that info, and also some editor IDEs can as well, so it can be worth it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm, good to know. I'll consider it next time ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the old deps builders:
builtins.TypeError: attrib() got an unexpected keyword argument 'factory'
This is an 18.1.0 feature in attrs and we depend on a min of 17.4. We should probably upgrade to 18.1, or fix this here to use default=attrs.Factory()
-- your choice (I prefer the former :) ).
* commit '9aee28927': Convert EventContext to attrs (#6218)
The main driver for this was to get a sensible
__repr__
, but the improved type-safety doesn't hurt.