Skip to content

Mypy Fix type annotations for a1z26, enigma_machine2, trafid_cipher and xor_cipher from ciphers #4761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a565258
Add files via upload
avivfaraj Sep 3, 2021
4951686
Changed print to f-string
avivfaraj Sep 4, 2021
ff2a162
Add files via upload
avivfaraj Sep 4, 2021
6550183
Fixes: #4710 provided return type
avivfaraj Sep 4, 2021
552546f
File exists in another pull request
avivfaraj Sep 4, 2021
bc31e3f
imported radians from math
avivfaraj Sep 5, 2021
974e0a6
Updated file according to pre-commit test
avivfaraj Sep 6, 2021
1d4fc81
Updated file
avivfaraj Sep 6, 2021
7bd84b4
Updated gamma
avivfaraj Sep 6, 2021
2841c11
Deleted duplicate file
avivfaraj Sep 6, 2021
cea2deb
removed pi
avivfaraj Sep 6, 2021
db7db3b
reversed tests
avivfaraj Sep 7, 2021
132e495
Fixed angle condition
avivfaraj Sep 7, 2021
c0e5071
Modified prints to f-string
avivfaraj Sep 7, 2021
894fa7f
Update horizontal_projectile_motion.py
avivfaraj Sep 7, 2021
ee49ce7
Merge branch 'TheAlgorithms:master' into master
avivfaraj Sep 7, 2021
07646ac
Update horizontal_projectile_motion.py
avivfaraj Sep 7, 2021
4e2fcaf
Fixes #4710 added exceptions and tests
avivfaraj Sep 7, 2021
dcacc95
Added float tests
avivfaraj Sep 7, 2021
3f2b238
Fixed type annotations
avivfaraj Sep 14, 2021
e3678fd
Fixed last annotation
avivfaraj Sep 14, 2021
c37bb95
Fixed annotations
avivfaraj Sep 14, 2021
5b0249a
fixed format
avivfaraj Sep 14, 2021
06e1eb7
Add files via upload
avivfaraj Sep 14, 2021
77365dc
Update a1z26.py
avivfaraj Sep 14, 2021
2c9d126
Update enigma_machine2.py
avivfaraj Sep 14, 2021
85b233d
Delete horizontal_projectile_motion.py
avivfaraj Sep 14, 2021
14410df
Update enigma_machine2.py
avivfaraj Sep 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ciphers/a1z26.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"""


from __future__ import annotations


def encode(plain: str) -> list[int]:
"""
>>> encode("myname")
Expand Down
8 changes: 6 additions & 2 deletions ciphers/enigma_machine2.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@

Created by TrapinchO
"""
from __future__ import annotations

RotorPositionT = tuple[int, int, int]
RotorSelectionT = tuple[str, str, str]
from typing import Tuple


RotorPositionT = Tuple[int, int, int]
RotorSelectionT = Tuple[str, str, str]


# used alphabet --------------------------
Expand Down
3 changes: 3 additions & 0 deletions ciphers/trafid_cipher.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# https://en.wikipedia.org/wiki/Trifid_cipher


from __future__ import annotations


def __encryptPart(messagePart: str, character2Number: dict[str, str]) -> str:
one, two, three = "", "", ""
tmp = []
Expand Down
3 changes: 3 additions & 0 deletions ciphers/xor_cipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"""


from __future__ import annotations


class XORCipher:
def __init__(self, key: int = 0):
"""
Expand Down