You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
443 B
22 lines
443 B
11 years ago
|
try:
|
||
|
frozenset
|
||
|
except NameError:
|
||
|
print("SKIP")
|
||
|
import sys
|
||
|
sys.exit()
|
||
|
|
||
|
l = [1, 2, 3, 4]
|
||
|
s = frozenset(l)
|
||
|
outs = [s.difference(),
|
||
|
s.difference(frozenset({1})),
|
||
|
s.difference(frozenset({1}), [1, 2]),
|
||
|
s.difference(frozenset({1}), {1, 2}, {2, 3})]
|
||
|
for out in outs:
|
||
|
print(type(out), sorted(out))
|
||
|
|
||
|
s = frozenset(l)
|
||
|
try:
|
||
|
print(s.difference_update({1}))
|
||
|
except AttributeError:
|
||
|
print("AttributeError")
|