forked from microsoft/edit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython.py
More file actions
48 lines (37 loc) · 860 Bytes
/
python.py
File metadata and controls
48 lines (37 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Single-line comment
'''Triple single quoted string'''
"""Triple double quoted string"""
single = 'single quoted string'
double = "double quoted string"
decimal = 42
negative = -3.14e+2
hex_value = 0x2A
binary_value = 0b101010
octal_value = 0o52
complex_value = 1.5j
truthy = True
falsy = False
nothing = None
@decorator
async def greet(name: str) -> None:
value = f"Hello, {name}"
if value and name is not None:
print(value)
elif value in {"hello", "world"}:
raise ValueError("unexpected")
else:
return None
for item in [single, double]:
while False:
break
try:
assert item
except Exception as exc:
yield exc
finally:
pass
class Person:
def __init__(self, name):
self.name = name
result = greet("world")
lambda_value = lambda x: x + 1