We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06b9a7a commit 2937755Copy full SHA for 2937755
CHANGELOG.md
@@ -5,6 +5,10 @@ We follow Semantic Versions since the `0.1.0` release.
5
6
## 0.10.0 WIP
7
8
+### Features
9
+
10
+- Adds `__hash__` magic methods to all containers
11
12
### Misc
13
14
- Updates `mypy` version
tests/test_io/test_io_equality.py
@@ -0,0 +1,19 @@
1
+# -*- coding: utf-8 -*-
2
3
+import pytest
4
+from returns.io import IO
+def test_equality():
+ """Ensures that containers can be compared."""
+ assert IO(1) == IO(1)
+ assert str(IO(1)) == '<IO: 1>'
+ assert hash(IO(1))
15
+def test_nonequality():
16
+ """Ensures that containers are not compared to regular values."""
17
+ assert IO(1) != 1
18
+ assert IO(1) is not IO(1)
19
+ assert IO(1) != IO(2)
0 commit comments