[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thank you for the patch. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 1b5f9c9653f348b0aa8b7ca39f8a9361150f7dfc by Raymond Hettinger (Naris R) in branch 'master': bpo-34427: Fix infinite loop when calling MutableSequence.extend() on self (GH-8813)

[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agreed. Appending >2**31 items one by one to the collection with external storage is not very efficient, so such collection likely has specialized extend(). -- ___ Python tracker

[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: > But a MutableSequence can represents a sequence that doesn't > fit in memory. It can provide an interface to a linear > on-disk store. In this case creating an on-memory copy > is not possible. This case is likely not worth worrying about. If a user

[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-24 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: +Python 3.6, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-18 Thread Naris R
Change by Naris R : -- keywords: +patch pull_requests: +8291 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list

[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: deque and bytearray make an in-memory copy of self if extended with self. deque creates a temporary list, bytearray creates a temporary bytearray. list just iterates itself as a linear array of known size and avoids infinite loop. It could be possible to

[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: It would be reasonable to add special handling for this case to match what is done in the concrete sequences like list, deque, bytes, ... -- assignee: -> rhettinger ___ Python tracker

[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-18 Thread Naris R
Change by Naris R : -- nosy: +rhettinger, stutzbach ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-18 Thread Naris R
Naris R added the comment: I forgot to copy over __len__ in the example -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue34427] calling MutableSequence.extend on self produces infinite loop

2018-08-18 Thread Naris R
New submission from Naris R : 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