mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 04:44:44 +00:00
Implement Array/SetWithLength
This commit is contained in:
parent
87bfe836ec
commit
e02def52ab
5 changed files with 55 additions and 7 deletions
|
@ -4,5 +4,12 @@ def in_operator(x, y):
|
|||
return True
|
||||
# TODO: trait check
|
||||
return False
|
||||
elif type(y) == list or type(y) == set:
|
||||
# FIXME:
|
||||
type_check = in_operator(x[0], y[0])
|
||||
len_check = len(x) == len(y)
|
||||
return type_check and len_check
|
||||
elif type(y) == dict:
|
||||
NotImplemented
|
||||
else:
|
||||
return x in y
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue