Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 2, 2024
1 parent 7087882 commit 830fff7
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 49 deletions.
14 changes: 7 additions & 7 deletions nrw/algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
from __future__ import annotations

__all__: Final[list[str]] = [
"linear_search",
"depth_first_search",
"breadth_first_search",
"bubble_sort",
"selection_sort",
"depth_first_search",
"inorder",
"insertion_sort",
"levelorder",
"linear_search",
"merge_sort",
"quick_sort",
"preorder",
"inorder",
"postorder",
"levelorder",
"preorder",
"quick_sort",
"selection_sort",
]

from typing import Final
Expand Down
14 changes: 7 additions & 7 deletions nrw/algorithms/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# pylint: skip-file
__all__: Final[list[str]] = [
"linear_search",
"depth_first_search",
"breadth_first_search",
"bubble_sort",
"selection_sort",
"depth_first_search",
"inorder",
"insertion_sort",
"levelorder",
"linear_search",
"merge_sort",
"quick_sort",
"preorder",
"inorder",
"postorder",
"levelorder",
"preorder",
"quick_sort",
"selection_sort",
]

from typing import Final, TypeVar, overload
Expand Down
4 changes: 2 additions & 2 deletions nrw/algorithms/_searching.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from __future__ import annotations

__all__: Final[list[str]] = [
"linear_search",
"depth_first_search",
"breadth_first_search",
"depth_first_search",
"linear_search",
]

from typing import TYPE_CHECKING, Final, TypeVar
Expand Down
2 changes: 1 addition & 1 deletion nrw/algorithms/_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

__all__: Final[list[str]] = [
"bubble_sort",
"selection_sort",
"insertion_sort",
"merge_sort",
"quick_sort",
"selection_sort",
]

from typing import TYPE_CHECKING, Final
Expand Down
4 changes: 2 additions & 2 deletions nrw/algorithms/_traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from __future__ import annotations

__all__: Final[list[str]] = [
"preorder",
"inorder",
"postorder",
"levelorder",
"postorder",
"preorder",
]

from typing import Final, TypeVar
Expand Down
2 changes: 1 addition & 1 deletion nrw/database/_query_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class QueryResult:
Die Klasse verfügt über keinen öffentlichen Konstruktor.
"""

__slots__: Final[tuple[str, str, str]] = ("_data", "_column_names", "_column_types")
__slots__: Final[tuple[str, str, str]] = ("_column_names", "_column_types", "_data")

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion nrw/database/_query_result.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ __all__: Final[list[str]] = ["QueryResult"]
from typing import Any, Final

class QueryResult:
__slots__: Final[tuple[str, str, str]] = ("_data", "_column_names", "_column_types")
__slots__: Final[tuple[str, str, str]] = ("_column_names", "_column_types", "_data")
def __init__(
self,
data: list[tuple[Any, ...]],
Expand Down
10 changes: 5 additions & 5 deletions nrw/datastructures/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
from __future__ import annotations

__all__: Final[list[str]] = [
"Stack",
"Queue",
"List",
"BinarySearchTree",
"BinaryTree",
"ComparableContent",
"ComparableContentT",
"Vertex",
"Edge",
"BinarySearchTree",
"Graph",
"List",
"Queue",
"Stack",
"Vertex",
]


Expand Down
16 changes: 8 additions & 8 deletions nrw/datastructures/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# pylint: skip-file
__all__: Final[list[str]] = [
"Stack",
"Queue",
"List",
"BinarySearchTree",
"BinaryTree",
"ComparableContent",
"ComparableContentT",
"Vertex",
"Edge",
"BinarySearchTree",
"Graph",
"List",
"Queue",
"Stack",
"Vertex",
]

from typing import Final, Generic, TypeVar, overload
Expand Down Expand Up @@ -43,7 +43,7 @@ class Stack(Generic[_T]):
def top(self) -> _T | None: ...

class List(Generic[_T]):
__slots__: Final[tuple[str, str, str]] = ("_first", "_last", "_current")
__slots__: Final[tuple[str, str, str]] = ("_current", "_first", "_last")
__hash__ = None # type: ignore[assignment]

def __init__(self) -> None: ...
Expand Down Expand Up @@ -131,7 +131,7 @@ class Vertex:
def is_marked(self) -> bool: ...

class Edge:
__slots__: Final[tuple[str, str, str]] = ("_vertices", "_weight", "_mark")
__slots__: Final[tuple[str, str, str]] = ("_mark", "_vertices", "_weight")
__hash__ = None # type: ignore[assignment]

def __init__(self, vertex: Vertex, another_vertex: Vertex, weight: int) -> None: ...
Expand All @@ -149,7 +149,7 @@ class Edge:
def is_marked(self) -> bool: ...

class Graph:
__slots__: Final[tuple[str, str]] = ("_vertices", "_edges")
__slots__: Final[tuple[str, str]] = ("_edges", "_vertices")
__hash__ = None # type: ignore[assignment]

def __init__(self) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion nrw/datastructures/_edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Edge:
und eine Markierung gesetzt und abgefragt werden.
"""

__slots__: Final[tuple[str, str, str]] = ("_vertices", "_weight", "_mark")
__slots__: Final[tuple[str, str, str]] = ("_mark", "_vertices", "_weight")
__hash__ = None # type: ignore[assignment]

def __init__(self, vertex: Vertex, another_vertex: Vertex, weight: int) -> None:
Expand Down
2 changes: 1 addition & 1 deletion nrw/datastructures/_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Graph:
Knotenobjekt zu einer bestimmten ID gehört und ob der Graph leer ist.
"""

__slots__: Final[tuple[str, str]] = ("_vertices", "_edges")
__slots__: Final[tuple[str, str]] = ("_edges", "_vertices")
__hash__ = None # type: ignore[assignment]

def __init__(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion nrw/datastructures/_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class List(Generic[_T]):
kann vor dem aktuellen Objekt ein Listenobjekt eingefügt werden.
"""

__slots__: Final[tuple[str, str, str]] = ("_first", "_last", "_current")
__slots__: Final[tuple[str, str, str]] = ("_current", "_first", "_last")
__hash__ = None # type: ignore[assignment]

def __init__(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion nrw/network/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

__all__: Final[list[str]] = ["Connection", "Client", "Server"]
__all__: Final[list[str]] = ["Client", "Connection", "Server"]

from typing import Final

Expand Down
8 changes: 4 additions & 4 deletions nrw/network/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# pylint: skip-file
__all__: Final[list[str]] = ["Connection", "Client", "Server"]
__all__: Final[list[str]] = ["Client", "Connection", "Server"]

from abc import ABC, abstractmethod
from typing import Final

class Connection:
__slots__: Final[tuple[str, str, str]] = ("_socket", "_to_server", "_from_server")
__slots__: Final[tuple[str, str, str]] = ("_from_server", "_socket", "_to_server")
def __init__(self, server_ip: str, server_port: int) -> None: ...
def receive(self) -> str | None: ...
def send(self, message: str) -> None: ...
def close(self) -> None: ...

class Client(ABC):
__slots__: Final[tuple[str, str]] = ("_socket_wrapper", "_active")
__slots__: Final[tuple[str, str]] = ("_active", "_socket_wrapper")
def __init__(self, server_ip: str, server_port: int) -> None: ...
@property
def is_connected(self) -> bool: ...
Expand All @@ -25,8 +25,8 @@ class Server(ABC):
__slots__: Final[tuple[str, str, str, str]] = (
"__weakref__",
"_connection_handler",
"_message_handlers",
"_lock",
"_message_handlers",
)
def __init__(self, port: int) -> None: ...
@property
Expand Down
4 changes: 2 additions & 2 deletions nrw/network/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


class _SocketWrapper:
__slots__: Final[tuple[str, str, str]] = ("_socket", "_to_server", "_from_server")
__slots__: Final[tuple[str, str, str]] = ("_from_server", "_socket", "_to_server")

def __init__(self, server_ip: str, server_port: int) -> None:
try:
Expand Down Expand Up @@ -73,7 +73,7 @@ class Client(ABC):
Eine einmal unterbrochene oder getrennte Verbindung kann nicht reaktiviert werden.
"""

__slots__: Final[tuple[str, str]] = ("_socket_wrapper", "_active")
__slots__: Final[tuple[str, str]] = ("_active", "_socket_wrapper")

def __init__(self, server_ip: str, server_port: int) -> None:
"""Es wird eine Verbindung zum durch `server_ip` und `server_port`
Expand Down
2 changes: 1 addition & 1 deletion nrw/network/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Connection:
reaktiviert werden.
"""

__slots__: Final[tuple[str, str, str]] = ("_socket", "_to_server", "_from_server")
__slots__: Final[tuple[str, str, str]] = ("_from_server", "_socket", "_to_server")

def __init__(self, server_ip: str, server_port: int) -> None:
"""Ein Objekt vom Typ `Connection` wird erstellt. Dadurch wird eine Verbindung
Expand Down
8 changes: 4 additions & 4 deletions nrw/network/_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


class _NewConnectionHandler(threading.Thread):
__slots__: Final[tuple[str, str, str]] = ("_server", "_active", "_server_socket")
__slots__: Final[tuple[str, str, str]] = ("_active", "_server", "_server_socket")

def __init__(
self,
Expand Down Expand Up @@ -74,8 +74,8 @@ def close(self) -> None:
class _ClientSocketWrapper:
__slots__: Final[tuple[str, str, str]] = (
"_client_socket",
"_to_client",
"_from_client",
"_to_client",
)

def __init__(self, client_socket: socket.socket | None) -> None:
Expand Down Expand Up @@ -135,7 +135,7 @@ def close(self) -> None:


class _ClientMessageHandler(threading.Thread):
__slots__: Final[tuple[str, str, str]] = ("_server", "_active", "_socket_wrapper")
__slots__: Final[tuple[str, str, str]] = ("_active", "_server", "_socket_wrapper")

def __init__(self, client_socket: socket.socket | None, server: Server) -> None:
super().__init__()
Expand Down Expand Up @@ -210,9 +210,9 @@ class Server(ABC):

__slots__: Final[tuple[str, str, str, str]] = (
"__weakref__",
"_connection_handler",
"_lock",
"_message_handlers",
"_connection_handler",
)

def __init__(self, port: int) -> None:
Expand Down

0 comments on commit 830fff7

Please sign in to comment.