(cls, iterable)
| 899 | |
| 900 | @classmethod |
| 901 | def _make(cls, iterable): |
| 902 | # override factory to affect length check |
| 903 | num_fields = len(cls._fields) - 1 |
| 904 | result = cls.__new__(cls, *iterable) |
| 905 | if len(result) != num_fields + 1: |
| 906 | msg = f'Expected {num_fields} arguments, got {len(result)}' |
| 907 | raise TypeError(msg) |
| 908 | return result |
| 909 | |
| 910 | def __getitem__(self, key): |
| 911 | return tuple(self)[key] |