Skip to content

Commit 8c6c68a

Browse files
committed
Add a docstring for the bind method
1 parent 94e02b8 commit 8c6c68a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/textual/binding.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ def bind(
107107
key_display: str | None = None,
108108
universal: bool = False,
109109
) -> None:
110+
"""Bind keys to an action.
111+
112+
Args:
113+
keys (str): The keys to bind. Can be a comma-separated list of keys.
114+
action (str): The action to bind the keys to.
115+
description (str, optional): An optional description for the binding.
116+
show (bool, optional): A flag to say if the binding should appear in the footer.
117+
key_display (str | None, optional): Optional string to display in the footer for the key.
118+
universal (bool, optional): Allow forwarding from the app to the focused widget.
119+
"""
110120
all_keys = [key.strip() for key in keys.split(",")]
111121
for key in all_keys:
112122
self.keys[key] = Binding(

0 commit comments

Comments
 (0)