Skip to content

Commit a406d2a

Browse files
remove type annotations from examples so they are compatible with Python 3.8
Signed-off-by: Achille Roussel <[email protected]>
1 parent 6799ab3 commit a406d2a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/auto_retry.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
rng = random.Random(2)
99

1010

11-
def third_party_api_call(x: int) -> str:
11+
def third_party_api_call(x):
1212
# Simulate a third-party API call that fails.
1313
print(f"Simulating third-party API call with {x}")
1414
if x < 3:
@@ -19,7 +19,7 @@ def third_party_api_call(x: int) -> str:
1919

2020
# Use the `dispatch.function` decorator to declare a stateful function.
2121
@dispatch.function
22-
def application() -> str:
22+
def application():
2323
x = rng.randint(0, 5)
2424
return third_party_api_call(x)
2525

examples/getting_started.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Use the `dispatch.function` decorator declare a stateful function.
77
@dispatch.function
8-
def publish(url, payload) -> str:
8+
def publish(url, payload):
99
r = requests.post(url, data=payload)
1010
r.raise_for_status()
1111
return r.text

examples/github_stats.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@ def get_gh_api(url):
3131

3232

3333
@dispatch.function
34-
async def get_repo_info(repo_owner: str, repo_name: str) -> dict:
34+
async def get_repo_info(repo_owner, repo_name):
3535
url = f"https://api.github.com/repos/{repo_owner}/{repo_name}"
3636
repo_info = get_gh_api(url)
3737
return repo_info
3838

3939

4040
@dispatch.function
41-
async def get_contributors(repo_info: dict) -> list[dict]:
41+
async def get_contributors(repo_info):
4242
url = repo_info["contributors_url"]
4343
contributors = get_gh_api(url)
4444
return contributors
4545

4646

4747
@dispatch.function
48-
async def main() -> list[dict]:
48+
async def main():
4949
repo_info = await get_repo_info("dispatchrun", "coroutine")
5050
print(
5151
f"""Repository: {repo_info['full_name']}

0 commit comments

Comments
 (0)