Skip to content

Commit e8c5205

Browse files
committed
use more explicit type hint for COMMANDS
1 parent f37fb76 commit e8c5205

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pymodbus_repl/lib/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
)
7575

7676

77-
class Command(dict):
77+
class Command:
7878
"""Class representing Commands to be consumed by Completer."""
7979

8080
def __init__(self, name, signature, doc, slave=False):

pymodbus_repl/server/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import inspect
44
import shutil
55
from collections import defaultdict
6-
from typing import Optional
6+
from typing import Dict, Optional
77

88
import click
99
from prompt_toolkit import PromptSession, print_formatted_text
@@ -40,7 +40,7 @@
4040
)
4141
COMMAND_ARGS = ["response_type", "error_code", "delay_by", "clear_after", "data_len"]
4242
RESPONSE_TYPES = ["normal", "error", "delayed", "empty", "stray"]
43-
COMMANDS = {
43+
COMMANDS: Dict[str, Optional[Dict | Command]] = {
4444
"manipulator": {
4545
"response_type": None,
4646
"error_code": None,

0 commit comments

Comments
 (0)