frozenset is working now / further array conversion tests

This commit is contained in:
David Halter
2012-08-07 00:11:44 +02:00
parent 5f26d0c442
commit 8bd73d96cb
2 changed files with 29 additions and 2 deletions

View File

@@ -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
#--------------------------------------------------------

View File

@@ -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]