Skip to content

Commit dba821e

Browse files
authored
new challenge: empty-tuple (intermediate) (#94)
1 parent 84551ad commit dba821e

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Check out [annotating-tuples](https://docs.python.org/zh-cn/3/library/typing.html#annotating-tuples)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
TODO:
3+
4+
foo should accept a empty tuple argument.
5+
"""
6+
7+
8+
def foo(x):
9+
pass
10+
11+
12+
## End of your code ##
13+
foo(())
14+
foo((1)) # expect-type-error
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
TODO:
3+
4+
foo should accept a empty tuple argument.
5+
"""
6+
7+
8+
def foo(x: tuple[()]):
9+
pass
10+
11+
12+
## End of your code ##
13+
foo(())
14+
foo((1)) # expect-type-error

0 commit comments

Comments
 (0)