-
Notifications
You must be signed in to change notification settings - Fork 0
/
empty_util.py
47 lines (37 loc) · 875 Bytes
/
empty_util.py
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
def isEmpty(o):
if o is None:
return True
elif type(o) is str and len(o) == 0:
return True
elif isinstance(o, tuple) and len(o) == 0:
return True
elif isinstance(o, dict) and len(o) == 0:
return True
elif isinstance(o, list) and len(o) == 0:
return True
elif isinstance(o, set) and len(o) == 0:
return True
else:
return o is None
def isNotEmpty(o):
return not isEmpty(o)
def isEmptys(*o):
for d in o:
if isNotEmpty(d):
return False
return True
def isNotEmptys(*o):
for d in o:
if isEmpty(d):
return False
return True
def isEmptyII(*o):
for d in o:
if isEmpty(d):
return True
return False
def isNotEmptyII(*o):
for d in o:
if isNotEmpty(d):
return True
return False