MCPcopy
hub / github.com/MagicStack/asyncpg / Iterable

Class Iterable

tests/test_codecs.py:844–849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

842
843 # A sized iterable is fine as array input.
844 class Iterable:
845 def __iter__(self):
846 return iter([1, 2, 3])
847
848 def __len__(self):
849 return 3
850
851 result = await self.con.fetchval("SELECT $1::int[]", Iterable())
852 self.assertEqual(result, [1, 2, 3])

Callers 1

test_arraysMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_arraysMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…