mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-26 07:11:08 +08:00
frozenset is working now / further array conversion tests
This commit is contained in:
@@ -109,6 +109,18 @@ class set():
|
||||
return self
|
||||
|
||||
|
||||
class frozenset():
|
||||
def __init__(self, iterable=[]):
|
||||
self.iterable = iterable
|
||||
|
||||
def __iter__(self):
|
||||
for i in self.iterable:
|
||||
yield i
|
||||
|
||||
def copy(self):
|
||||
return self
|
||||
|
||||
|
||||
#--------------------------------------------------------
|
||||
# basic types
|
||||
#--------------------------------------------------------
|
||||
|
||||
@@ -187,8 +187,23 @@ GetItem("")[1]
|
||||
# conversions
|
||||
# -----------------
|
||||
|
||||
a = [1, ""]
|
||||
#? int() str()
|
||||
list([1,""])[1]
|
||||
list(a)[1]
|
||||
|
||||
#? int() str()
|
||||
list(set([1,""]))[1]
|
||||
list(a)[0]
|
||||
|
||||
#? int() str()
|
||||
list(set(a))[1]
|
||||
#? int() str()
|
||||
list(list(set(a)))[1]
|
||||
|
||||
# does not yet work, because the recursion catching is not good enough (catches # to much)
|
||||
##? int() str()
|
||||
list(set(list(set(a))))[1]
|
||||
##? int() str()
|
||||
list(set(set(a)))[1]
|
||||
|
||||
#? int() str()
|
||||
list(frozenset(a))[1]
|
||||
|
||||
Reference in New Issue
Block a user