mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 07:35:04 -04:00
Convert all namedtuples to attrs. (#11665)
To improve type hints throughout the code.
This commit is contained in:
parent
07a3b5daba
commit
cbd82d0b2d
22 changed files with 231 additions and 206 deletions
|
@ -12,16 +12,22 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from collections import namedtuple
|
||||
from typing import Iterable, List, Optional, Tuple
|
||||
|
||||
import attr
|
||||
|
||||
from synapse.api.errors import SynapseError
|
||||
from synapse.storage.database import LoggingTransaction
|
||||
from synapse.storage.databases.main import CacheInvalidationWorkerStore
|
||||
from synapse.types import RoomAlias
|
||||
from synapse.util.caches.descriptors import cached
|
||||
|
||||
RoomAliasMapping = namedtuple("RoomAliasMapping", ("room_id", "room_alias", "servers"))
|
||||
|
||||
@attr.s(slots=True, frozen=True, auto_attribs=True)
|
||||
class RoomAliasMapping:
|
||||
room_id: str
|
||||
room_alias: str
|
||||
servers: List[str]
|
||||
|
||||
|
||||
class DirectoryWorkerStore(CacheInvalidationWorkerStore):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue