Issue1336

classification
Title: PyDeque should likely subclass PySequence
Type: rfe Severity: minor
Components: Core Versions:
Milestone:
process
Status: open Resolution: remind
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, pjenvey, thatmattbone
Priority: low Keywords: patch

Created on 2009-05-03.21:28:03 by pjenvey, last changed 2014-07-17.17:16:53 by zyasoft.

Files
File name Uploaded Description Edit Remove
deque_repeated_code.patch thatmattbone, 2009-07-24.01:31:38 deque extends pysequence, reduces duplication
Messages
msg4629 (view) Author: Philip Jenvey (pjenvey) Date: 2009-05-03.21:28:02
PyDeque obviously cut and pasted much of PySequence, it looks very likely 
that it should be subclassing it instead.

Its tests also run through some of tests.seq_tests (but not all of them).
msg4938 (view) Author: Matt Bone (thatmattbone) Date: 2009-07-24.01:31:38
Here's my stab at a patch.  The tests pass, but it's probably all that
useful (the cpython deque does not extend sequence).
msg4954 (view) Author: Philip Jenvey (pjenvey) Date: 2009-07-28.05:58:20
Thanks for this, a couple things:

no tabs, just 4 space indents

pyget looks like cut and paste of getNode, I think they need 
refactoring..

Actually I think getNode is probably unnecessary if we have a working 
pyget. Then the PySequence __get/set/delitem__ methods can do all the 
work for us and we wouldn't have to override them to use getNode.

Those PySequence methods should also do the work of the first few lines 
of getNode for us (the adjusting of the index and throwing an IndexError 
if it's invalid) via PySequence.delegator
msg7372 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2012-08-10.20:19:54
Matt Bone: are you interested in pushing this forward and addressing Philip's concerns? Sorry this has languished...
msg7851 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-02-27.18:27:58
If anyone out there would like to push this patch forward I'd love to be able to address this. Sorry I was so slow to respond Matt :(
History
Date User Action Args
2014-07-17 17:16:53zyasoftsetresolution: remind
2013-02-27 18:27:58fwierzbickisetmessages: + msg7851
2012-08-10 20:19:55fwierzbickisetmessages: + msg7372
2010-08-25 05:58:27zyasoftsetpriority: low
2009-07-28 05:58:22pjenveysetmessages: + msg4954
2009-07-26 14:01:39fwierzbickisetnosy: + fwierzbicki
2009-07-24 01:31:40thatmattbonesetfiles: + deque_repeated_code.patch
keywords: + patch
messages: + msg4938
nosy: + thatmattbone
2009-05-03 21:28:03pjenveycreate