summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/basics/frozenset1.py3
-rw-r--r--tests/basics/set1.py6
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/basics/frozenset1.py b/tests/basics/frozenset1.py
index 00694581f0..7a4a335401 100644
--- a/tests/basics/frozenset1.py
+++ b/tests/basics/frozenset1.py
@@ -15,3 +15,6 @@ print(s)
s = frozenset({3, 4, 3, 1})
print(sorted(s))
+
+# frozensets are hashable unlike sets
+print({frozenset("1"): 2})
diff --git a/tests/basics/set1.py b/tests/basics/set1.py
index 399c33eb68..6afd9eb5ef 100644
--- a/tests/basics/set1.py
+++ b/tests/basics/set1.py
@@ -5,3 +5,9 @@ print(s)
s = {3, 4, 3, 1}
print(sorted(s))
+
+# Sets are not hashable
+try:
+ {s: 1}
+except TypeError:
+ print("TypeError")