mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-04-22 13:47:37 +00:00
Fixed type annotations
This commit is contained in:
parent
dcacc95b9d
commit
3f2b238c34
@ -14,9 +14,9 @@ Module includes:
|
|||||||
|
|
||||||
Created by TrapinchO
|
Created by TrapinchO
|
||||||
"""
|
"""
|
||||||
|
from typing import Tuple, Dict
|
||||||
RotorPositionT = tuple[int, int, int]
|
RotorPositionT = Tuple[int, int, int]
|
||||||
RotorSelectionT = tuple[str, str, str]
|
RotorSelectionT = Tuple[str, str, str]
|
||||||
|
|
||||||
|
|
||||||
# used alphabet --------------------------
|
# used alphabet --------------------------
|
||||||
@ -69,7 +69,7 @@ rotor9 = "KOAEGVDHXPQZMLFTYWJNBRCIUS"
|
|||||||
|
|
||||||
def _validator(
|
def _validator(
|
||||||
rotpos: RotorPositionT, rotsel: RotorSelectionT, pb: str
|
rotpos: RotorPositionT, rotsel: RotorSelectionT, pb: str
|
||||||
) -> tuple[RotorPositionT, RotorSelectionT, dict[str, str]]:
|
) -> tuple[RotorPositionT, RotorSelectionT, Dict[str, str]]:
|
||||||
"""
|
"""
|
||||||
Checks if the values can be used for the 'enigma' function
|
Checks if the values can be used for the 'enigma' function
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ def _validator(
|
|||||||
return rotpos, rotsel, pbdict
|
return rotpos, rotsel, pbdict
|
||||||
|
|
||||||
|
|
||||||
def _plugboard(pbstring: str) -> dict[str, str]:
|
def _plugboard(pbstring: str) -> Dict[str, str]:
|
||||||
"""
|
"""
|
||||||
https://en.wikipedia.org/wiki/Enigma_machine#Plugboard
|
https://en.wikipedia.org/wiki/Enigma_machine#Plugboard
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user