From 8f55fe0fec366ed3c38de30d433d3d19ff8d2685 Mon Sep 17 00:00:00 2001 From: MomIsBestFriend <> Date: Tue, 26 Nov 2019 03:52:36 +0200 Subject: [PATCH] Typing annotations --- pandas/io/clipboard/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/io/clipboard/__init__.py b/pandas/io/clipboard/__init__.py index 4f690a57893d1..ac8c2473a754c 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()) @@ -274,7 +274,7 @@ def copy_dev_clipboard(text): fo.write(text) fo.close() - def paste_dev_clipboard(): + def paste_dev_clipboard() -> str: fo = open("/dev/clipboard", "rt") content = fo.read() fo.close() @@ -288,7 +288,7 @@ class ClipboardUnavailable: def __call__(self, *args, **kwargs): raise PyperclipException(EXCEPT_MSG) - def __bool__(self): + def __bool__(self) -> bool: return False return ClipboardUnavailable(), ClipboardUnavailable() @@ -652,7 +652,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