New submission from Naris R <nariscat...@gmail.com>:
Example: ``` from typing import MutableSequence, TypeVar CliffordGate = TypeVar('CliffordGate') class QCircuit(MutableSequence[CliffordGate]): def __init__(self, gates): self.gates = list(gates) def __repr__(self): return f'{self.__class__.__name__}({self.gates})' def __getitem__(self, key): return self.gates[key] def __setitem__(self, key, item): self.gates[key] = item def __delitem__(self, key): del self.gates[key] def insert(self, key, item): self.gates.insert(key, item) a = QCircuit(['H0', 'S2']) a += a ``` ---------- components: Library (Lib) messages: 323696 nosy: Naris R priority: normal severity: normal status: open title: calling MutableSequence.extend on self produces infinite loop type: behavior versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34427> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com