diff --git a/pandas/io/clipboard/__init__.py b/pandas/io/clipboard/__init__.py index 4cc81a22a60a4..7d3dbaf6ee021 100644 --- a/pandas/io/clipboard/__init__.py +++ b/pandas/io/clipboard/__init__.py @@ -91,7 +91,7 @@ def __init__(self, message): super().__init__(message) -def _stringifyText(text): +def _stringifyText(text) -> str: acceptedTypes = (str, int, float, bool) if not isinstance(text, acceptedTypes): raise PyperclipException( @@ -156,7 +156,7 @@ def copy_qt(text): cb = app.clipboard() cb.setText(text) - def paste_qt(): + def paste_qt() -> str: cb = app.clipboard() return str(cb.text()) @@ -273,7 +273,7 @@ def copy_dev_clipboard(text): with open("/dev/clipboard", "wt") as fo: fo.write(text) - def paste_dev_clipboard(): + def paste_dev_clipboard() -> str: with open("/dev/clipboard", "rt") as fo: content = fo.read() return content @@ -286,7 +286,7 @@ class ClipboardUnavailable: def __call__(self, *args, **kwargs): raise PyperclipException(EXCEPT_MSG) - def __bool__(self): + def __bool__(self) -> bool: return False return ClipboardUnavailable(), ClipboardUnavailable() @@ -650,7 +650,7 @@ def lazy_load_stub_paste(): return paste() -def is_available(): +def is_available() -> bool: return copy != lazy_load_stub_copy and paste != lazy_load_stub_paste