forked from UnitTestBot/UTBotJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtuples.py
More file actions
36 lines (24 loc) · 652 Bytes
/
Copy pathtuples.py
File metadata and controls
36 lines (24 loc) · 652 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
import typing
class MyClass:
def __init__(self, x: int):
self.x = x
def __eq__(self, other):
return self.x == other.x
def __hash__(self):
return hash(self.x)
def f(x: typing.Tuple[int, ...]):
if len(x) == 0:
return "Empty!"
return len(x)
def f1(x: typing.Tuple[int, int, int]):
if len(x) != 3:
return "Very bad input!!!"
return x[0] + x[1] + x[2]
def g(x: typing.Tuple[MyClass, ...]):
if len(x) == 0:
return "Empty!"
return len(x)
def g1(x: typing.Tuple[MyClass, MyClass]):
if len(x) != 2:
return "Very bad input!!!"
return x[0].x + x[1].x