Skip to content

Commit

Permalink
Typing annotations (pandas-dev#29850)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaharNaveh authored and proost committed Dec 19, 2019
1 parent f8563f9 commit cc9f925
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pandas/io/clipboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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())

Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit cc9f925

Please sign in to comment.