Browse Source

remove `__slots__`

pull/43/head
Alex Nørgaard 2 years ago
parent
commit
5d781735e9
No known key found for this signature in database GPG Key ID: 94D54F6A3604E97
  1. 16
      a2s/a2s_async.py
  2. 10
      a2s/a2s_fragment.py
  3. 5
      a2s/a2s_sync.py
  4. 12
      a2s/byteio.py

16
a2s/a2s_async.py

@ -87,15 +87,7 @@ async def request_async_impl(
class A2SProtocol(asyncio.DatagramProtocol):
__slots__ = (
"recv_queue",
"error_event",
"error",
"fragment_buf",
"transport",
)
def __init__(self):
def __init__(self) -> None:
self.recv_queue: asyncio.Queue[bytes] = asyncio.Queue()
self.error_event: asyncio.Event = asyncio.Event()
self.error: Optional[Exception] = None
@ -147,12 +139,6 @@ class A2SProtocol(asyncio.DatagramProtocol):
class A2SStreamAsync:
__slots__ = (
"transport",
"protocol",
"timeout",
)
def __init__(
self,
transport: asyncio.DatagramTransport,

10
a2s/a2s_fragment.py

@ -5,16 +5,6 @@ from a2s.byteio import ByteReader
class A2SFragment:
__slots__ = (
"message_id",
"fragment_count",
"fragment_id",
"mtu",
"decompressed_size",
"crc",
"payload",
)
def __init__(
self,
message_id: int,

5
a2s/a2s_sync.py

@ -71,11 +71,6 @@ def request_sync_impl(
class A2SStream:
__slots__ = (
"address",
"_socket",
)
def __init__(self, address: Tuple[str, int], timeout: float) -> None:
self.address: Tuple[str, int] = address
self._socket: socket.socket = socket.socket(

12
a2s/byteio.py

@ -8,12 +8,6 @@ from a2s.exceptions import BufferExhaustedError
class ByteReader:
__slots__ = (
"stream",
"endian",
"encoding",
)
def __init__(
self,
stream: io.BytesIO,
@ -103,12 +97,6 @@ class ByteReader:
class ByteWriter:
__slots__ = (
"stream",
"endian",
"encoding",
)
def __init__(
self,
stream: io.BytesIO,

Loading…
Cancel
Save