Skip to content

Commit

Permalink
add type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
abe-101 committed Jul 19, 2022
1 parent 7c140eb commit ca8706a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions patterns/behavioral/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@
"""


def get_text():
def get_text() -> str:
return "plain-text"


def get_pdf():
def get_pdf() -> str:
return "pdf"


def get_csv():
def get_csv() -> str:
return "csv"


def convert_to_text(data):
def convert_to_text(data: str) -> str:
print("[CONVERT]")
return f"{data} as text"


def saver():
def saver() -> None:
print("[SAVE]")


def template_function(getter, converter=False, to_save=False):
def template_function(getter, converter=False, to_save=False) -> None:
data = getter()
print(f"Got `{data}`")

Expand Down

0 comments on commit ca8706a

Please sign in to comment.