MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / Iterable

Class Iterable

tests/test_codecs.py:890–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

888
889 # A sized iterable is fine as array input.
890 class Iterable:
891 def __iter__(self):
892 return iter([1, 2, 3])
893
894 def __len__(self):
895 return 3
896
897 result = await self.con.fetchval("SELECT $1::int[]", Iterable())
898 self.assertEqual(result, [1, 2, 3])

Callers 1

test_arraysMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_arraysMethod · 0.68