fun
This commit is contained in:
1 parent
711c6474cc
commit
886ae12241
1 file changed
+10
-4
+10
-4
@@ -1,3 +1,6 @@
|
|||||||
|
from collections.abc import Callable
|
||||||
|
|
||||||
|
|
||||||
class Person:
|
class Person:
|
||||||
def __init__(self, p: int, g: int, k: int):
|
def __init__(self, p: int, g: int, k: int):
|
||||||
self.p, self.g, self.k = p, g, k
|
self.p, self.g, self.k = p, g, k
|
||||||
@@ -11,11 +14,14 @@ class Person:
|
|||||||
return self.s
|
return self.s
|
||||||
|
|
||||||
|
|
||||||
|
def damn(p, g) -> Callable[[int], Person]:
|
||||||
|
return lambda k: Person(p, g, k)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
p = 23
|
demo = damn(p=23, g=5)
|
||||||
g = 5
|
alice = demo(4)
|
||||||
alice = Person(p, g, 4)
|
bob = demo(3)
|
||||||
bob = Person(p, g, 3)
|
|
||||||
assert (
|
assert (
|
||||||
alice.recieve_public_key(bob.public_key())
|
alice.recieve_public_key(bob.public_key())
|
||||||
== bob.recieve_public_key(alice.public_key())
|
== bob.recieve_public_key(alice.public_key())
|
||||||
|
|||||||
Reference in new issue
Block a user