| 598 | |
| 599 | # Implements the Sequence protocol without explicitly inheriting from collections.abc.Sequence. |
| 600 | class BareSequenceLike: |
| 601 | def __init__(self, *args): |
| 602 | self.data = tuple(args) |
| 603 | |
| 604 | def __len__(self): |
| 605 | return len(self.data) |
| 606 | |
| 607 | def __getitem__(self, index): |
| 608 | return self.data[index] |
| 609 | |
| 610 | # Implements the Sequence protocol by reusing BareSequenceLike's implementation. |
| 611 | # Additionally, inherits from collections.abc.Sequence. |
no outgoing calls