Given an list of items [a,b,a,b...], generate pairs [(a,b),(a,b)...]. Args: items: A list of items (length must be even) Yields: The original items, in pairs
(items)
| 491 | |
| 492 | |
| 493 | def _gen_pairs(items): |
| 494 | """Given an list of items [a,b,a,b...], generate pairs [(a,b),(a,b)...]. |
| 495 | |
| 496 | Args: |
| 497 | items: A list of items (length must be even) |
| 498 | |
| 499 | Yields: |
| 500 | The original items, in pairs |
| 501 | """ |
| 502 | assert len(items) % 2 == 0 |
| 503 | items = iter(items) |
| 504 | while True: |
| 505 | try: |
| 506 | yield next(items), next(items) |
| 507 | except StopIteration: |
| 508 | return |
| 509 | |
| 510 | |
| 511 | class _FunctionDetail( |
no outgoing calls
no test coverage detected