-
Notifications
You must be signed in to change notification settings - Fork 0
/
internal.py
20 lines (19 loc) · 1022 Bytes
/
internal.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
################################################################################
# Filename: internal.py #
# Created by: Venceslas Duet #
# Created at: 04-05-2018 #
# Last update at: 03-15-2022 #
# Description: Collection of check functions #
# Licence: None #
################################################################################
def correct_tuple(element, tuple_type, length=-1):
if not (isinstance(element, tuple) or
isinstance(element, list)):
return False
length = length if length > 0 else len(element)
if len(element) != length:
return False
for i in range(length):
if type(element[i]) != tuple_type:
return False
return True