Add vision of Python API

This commit is contained in:
Michael Bradley 2025-01-04 00:16:38 +13:00
parent b273772722
commit a09b71cdb3
Signed by: MichaelBradley
SSH key fingerprint: SHA256:cj/YZ5VT+QOKncqSkx+ibKTIn0Obg7OIzwzl9BL8EO8
2 changed files with 62 additions and 3 deletions

18
main.py
View file

@ -1,5 +1,19 @@
#!/bin/env python
from pyority_queue import sum_as_string
from pyority_queue import PureQueue, KeyedQueue
print(sum_as_string(10, 15))
def main() -> None:
pure = PureQueue()
pure["second"] = 3.4
pure["first"] = 1.2
pure["third"] = 5.6
print(*pure)
keyed = KeyedQueue({"third": 5.6, "second": 3.4, "first": 7.8})
del keyed["third"]
keyed["first"] = 1.2
print(*keyed)
if __name__ == "__main__":
main()