~sircmpwn/hiprompt-gtk-py

bf8f5c46f53fccd9518667c1207b212e236a0d1d — Martijn Braam 2 years ago e8843c6
Make the Key iterable
1 files changed, 5 insertions(+), 0 deletions(-)

M hiprompt_gtk/key.py
M hiprompt_gtk/key.py => hiprompt_gtk/key.py +5 -0
@@ 1,6 1,7 @@
import shlex
from io import StringIO


class Key:
    def __init__(self, key):
        self._pairs = []


@@ 49,6 50,10 @@ class Key:
    def __repr__(self):
        return f"<{str(self)}>"

    def __iter__(self):
        return iter(self._pairs)


class Pair:
    def __init__(self, key, value=None, optional=False, private=False):
        self.key = key