Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 00cfc95

Browse filesBrowse files
GameRoManiennae
andauthored
Fix type annotations (GoogleCloudPlatform#13358)
* Fix type annotations * fix: update the syntax to use | the type hint str | (str, int) is not the correct syntax for defining a union type that includes a tuple. * Use typing module for annotations instead (for python version <3.10) --------- Co-authored-by: Jennifer Davis <sigje@google.com>
1 parent 02a0c8e commit 00cfc95
Copy full SHA for 00cfc95

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
  • trace/cloud-trace-demo-app-opentelemetry/app
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎trace/cloud-trace-demo-app-opentelemetry/app/app.py

Copy file name to clipboardExpand all lines: trace/cloud-trace-demo-app-opentelemetry/app/app.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import random
2121
import time
2222

23+
from typing import Tuple, Union
24+
2325
import flask
2426

2527
# [START trace_demo_imports]
@@ -62,7 +64,7 @@ def configure_exporter(exporter):
6264

6365

6466
@app.route("/")
65-
def template_test() -> str or (str, int):
67+
def template_test() -> Union[str, Tuple[str, int]]:
6668
# Sleep for a random time to imitate a random processing time
6769
time.sleep(random.uniform(0, 0.5))
6870

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.