mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 08:56:04 -04:00
Upgrade mypy to version 0.931 (#12030)
Upgrade mypy to 0.931, mypy-zope to 0.3.5 and fix new complaints.
This commit is contained in:
parent
eb609c65d0
commit
e6acd3cf4f
9 changed files with 33 additions and 19 deletions
|
@ -37,14 +37,16 @@ class _EventSourcesInner:
|
|||
account_data: AccountDataEventSource
|
||||
|
||||
def get_sources(self) -> Iterator[Tuple[str, EventSource]]:
|
||||
for attribute in _EventSourcesInner.__attrs_attrs__: # type: ignore[attr-defined]
|
||||
for attribute in attr.fields(_EventSourcesInner):
|
||||
yield attribute.name, getattr(self, attribute.name)
|
||||
|
||||
|
||||
class EventSources:
|
||||
def __init__(self, hs: "HomeServer"):
|
||||
self.sources = _EventSourcesInner(
|
||||
*(attribute.type(hs) for attribute in _EventSourcesInner.__attrs_attrs__) # type: ignore[attr-defined]
|
||||
# mypy thinks attribute.type is `Optional`, but we know it's never `None` here since
|
||||
# all the attributes of `_EventSourcesInner` are annotated.
|
||||
*(attribute.type(hs) for attribute in attr.fields(_EventSourcesInner)) # type: ignore[misc]
|
||||
)
|
||||
self.store = hs.get_datastore()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue