This commit is contained in:
lda committed 2026-03-05 07:34:28 +07:00
1 parent 711c6474cc
commit 886ae12241
1 file changed
+10 -4
+10 -4
View File
@@ -1,3 +1,6 @@
from collections.abc import Callable
class Person:
def __init__(self, p: int, g: int, k: int):
self.p, self.g, self.k = p, g, k
@@ -11,11 +14,14 @@ class Person:
return self.s
def damn(p, g) -> Callable[[int], Person]:
return lambda k: Person(p, g, k)
def main():
p = 23
g = 5
alice = Person(p, g, 4)
bob = Person(p, g, 3)
demo = damn(p=23, g=5)
alice = demo(4)
bob = demo(3)
assert (
alice.recieve_public_key(bob.public_key())
== bob.recieve_public_key(alice.public_key())