Encode any bytes in a list, noting the index of what is encoded.
(self, data, path)
| 79 | return data, [] |
| 80 | |
| 81 | def _encode_list(self, data, path): |
| 82 | """Encode any bytes in a list, noting the index of what is encoded.""" |
| 83 | new_data = [] |
| 84 | encoded = [] |
| 85 | for i, value in enumerate(data): |
| 86 | new_path = path + [i] |
| 87 | new_value, new_encoded = self._encode(value, new_path) |
| 88 | new_data.append(new_value) |
| 89 | encoded.extend(new_encoded) |
| 90 | return new_data, encoded |
| 91 | |
| 92 | def _encode_dict(self, data, path): |
| 93 | """Encode any bytes in a dict, noting the index of what is encoded.""" |