Skip to content

Commit 35492df

Browse files
committed
Add missing type hints
1 parent 4faee33 commit 35492df

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/prompt_toolkit/filters/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def has_any_validation_error() -> bool:
178178
from prompt_toolkit.layout.controls import UIControl, BufferControl, SearchBufferControl
179179

180180
# Extract buffer validation errors for buffer UIControl children classes
181-
def get_buffer_from_content(content: UIControl):
181+
def get_buffer_from_content(content: UIControl) -> bool:
182182
if isinstance(content, (BufferControl, SearchBufferControl)):
183183
return content.buffer.validation_error is not None
184184
else:

src/prompt_toolkit/widgets/toolbars.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def __pt_container__(self) -> Container:
342342

343343

344344
class ValidationToolbar:
345-
def __init__(self, show_position: bool = False, buffer: Buffer = None) -> None:
345+
def __init__(self, show_position: bool = False, buffer: Buffer | None = None) -> None:
346346
def get_formatted_text() -> StyleAndTextTuples:
347347
# If buffer not specified, use the currently focused buffer
348348
if buffer is None:

0 commit comments

Comments
 (0)