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 695b8f0 commit 46f468cCopy full SHA for 46f468c
asyncpg/types.py
@@ -101,7 +101,7 @@ def __eq__(self, other):
101
other._empty
102
)
103
104
- def __hash__(self, other):
+ def __hash__(self):
105
return hash((
106
self._lower,
107
self._upper,
tests/test_codecs.py
@@ -817,6 +817,16 @@ async def test_range_types(self):
817
ValueError, 'expected 0, 1 or 2 elements'):
818
await self.con.fetch("SELECT $1::int4range", (0, 2, 3))
819
820
+ cases = [(asyncpg.Range(0, 1), asyncpg.Range(0, 1), 1),
821
+ (asyncpg.Range(0, 1), asyncpg.Range(0, 2), 2),
822
+ (asyncpg.Range(empty=True), asyncpg.Range(0, 2), 2),
823
+ (asyncpg.Range(empty=True), asyncpg.Range(empty=True), 1),
824
+ (asyncpg.Range(0, 1, upper_inc=True), asyncpg.Range(0, 1), 2),
825
+ ]
826
+ for obj_a, obj_b, count in cases:
827
+ dic = {obj_a: 1, obj_b: 2}
828
+ self.assertEqual(len(dic), count)
829
+
830
async def test_extra_codec_alias(self):
831
"""Test encoding/decoding of a builtin non-pg_catalog codec."""
832
await self.con.execute('''
0 commit comments