Pārlūkot izejas kodu

Fix annotations

Kirk Trombley 4 gadi atpakaļ
vecāks
revīzija
644c4e17f4
1 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 4 3
      lib/rollbot/types.py

+ 4 - 3
lib/rollbot/types.py

@@ -2,6 +2,7 @@ from dataclasses import dataclass, field
 from datetime import datetime
 from datetime import datetime
 from collections.abc import Callable, Coroutine, Container
 from collections.abc import Callable, Coroutine, Container
 from typing import Union, Any, Optional
 from typing import Union, Any, Optional
+from __future__ import annotations
 
 
 from aiosqlite.core import Connection
 from aiosqlite.core import Connection
 
 
@@ -34,7 +35,7 @@ class Command:
     args: str
     args: str
 
 
     @staticmethod
     @staticmethod
-    def from_text(text: str) -> Optional["Command"]:
+    def from_text(text: str) -> Optional[Command]:
         cleaned = text.lstrip()
         cleaned = text.lstrip()
 
 
         if len(cleaned) < 2:
         if len(cleaned) < 2:
@@ -61,7 +62,7 @@ class Response:
     @staticmethod
     @staticmethod
     def from_message(
     def from_message(
         msg: Message, text: Optional[str] = None, attachments: list[Attachment] = None
         msg: Message, text: Optional[str] = None, attachments: list[Attachment] = None
-    ) -> "Response":
+    ) -> Response:
         return Response(
         return Response(
             origin_id=msg.origin_id,
             origin_id=msg.origin_id,
             channel_id=msg.channel_id,
             channel_id=msg.channel_id,
@@ -90,7 +91,7 @@ class CommandConfiguration:
     startup: list[StartupShutdownType] = field(default_factory=list)
     startup: list[StartupShutdownType] = field(default_factory=list)
     shutdown: list[StartupShutdownType] = field(default_factory=list)
     shutdown: list[StartupShutdownType] = field(default_factory=list)
 
 
-    def extend(self, other: "CommandConfiguration") -> "CommandConfiguration":
+    def extend(self, other: CommandConfiguration) -> CommandConfiguration:
         return CommandConfiguration(
         return CommandConfiguration(
             commands={
             commands={
                 **self.commands,
                 **self.commands,