[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2008-01-13 Thread Christian Heimes
New submission from Christian Heimes: Raymond Hettinger wrote: Here's a couple more if you want to proceed down that path: 1. Have structseq subclass from PyTupleObject so that isinstance(s, tuple) returns True. This makes the object usable whenever tuples are needed. 2. Add _fields, _asdict

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2008-01-13 Thread Leif Walsh
Leif Walsh added the comment: Here is a patch for #1. I ran make test, and nothing was broken that seemed to be my fault, so I assume it's okay. Yes, it's small, it's my first one here. I'll get to the other two tomorrow. -- nosy: +adlaiff6 Added file: http://bugs.python.org/file9159/

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2008-01-14 Thread Raymond Hettinger
Changes by Raymond Hettinger: -- assignee: -> rhettinger __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2008-01-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the patch. I removed the whitespace changes and added some tests to make sure structseq now works with the % formatting operator and isinstance(t,tuple). Am getting a sporadic segfault in test_zipimport when running "make test", so holding-off on

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2008-01-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: Run, "make test" a few times to make sure it doesn't bomb. The problem may be due to needing a deferred_type instead of assigning &PyTupleObject directly. Will look it more later. __ Tracker <[EMAIL PROTECTED]>

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2008-01-14 Thread Leif Walsh
Leif Walsh added the comment: I just svn upped (it updated zipimport) and applied your patch, and './python Lib/test/regrtest.py test_zipimport.py' says it's okay, so I would go ahead and commit it. __ Tracker <[EMAIL PROTECTED]>

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2008-01-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: It worked fine on a fresh check-out. Committed in revision 59967. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2008-02-23 Thread Georg Brandl
Georg Brandl added the comment: Is there something else to be done for this to be closed? -- nosy: +georg.brandl __ Tracker <[EMAIL PROTECTED]> __ _

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2008-02-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: All three items are still open. The second one is the easiest. __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-li

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2010-04-29 Thread Eric Smith
Changes by Eric Smith : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2010-04-29 Thread Eric Smith
Eric Smith added the comment: See also issue 8413, which would be addressed by this change. -- ___ Python tracker ___ ___ Python-bugs-

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2010-04-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: I agree that the priority is higher now that we have a demonstrable regression. Getting structseq to subclass from tuple will take some effort (tuples have many methods that would need to be overriden). -- priority: low -> normal _

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2010-06-02 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2010-07-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: structseq now does subclass tuple, so if there's any interest in adding namedtuple APIs, now it should be easier. -- nosy: +benjamin.peterson ___ Python tracker ___

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2010-08-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Would whatever remains of this be deferred by the PEP3003 moratorium? -- nosy: +terry.reedy versions: -Python 2.7, Python 3.1 ___ Python tracker __

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2010-08-09 Thread Eric Smith
Eric Smith added the comment: I don't think it would be covered by the moratorium, since it's not a language change. The change to make structseq derive from tuple was not subject to the moratorium, for example. -- ___ Python tracker

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2010-08-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is definitely not covered by the language moratorium. Guido has requested this change and it needs to go forward. -- ___ Python tracker __

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2010-08-24 Thread Geoffrey Bache
Changes by Geoffrey Bache : -- nosy: +gjb1002 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2011-04-08 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2011-04-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Issue5907 would benefit of this change. Unfortunately, structseq constructors already have keyword arguments; they are equivalent to "def __new__(cls, sequence, dict=NULL)". OTOH these keywords arguments are not documented anywhere. I suggest to change t

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2011-04-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: Also see issue 11698 -- assignee: jackdied -> rhettinger ___ Python tracker ___ ___ Python-bugs-l

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2011-04-08 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Hasn't this been fixed in the following changeset? changeset: 43509:384f73a104e9 user:Benjamin Peterson date:Wed Jul 07 20:54:01 2010 + summary: make struct sequences subclass tuple; kill lots of code -- nosy: +belopols

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2011-04-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Hasn't this been fixed in the following changeset? It was a major step forward. Now there needs to be work on other namedtuple methods and whatnot. -- ___ Python tracker __

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2011-04-16 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- versions: +Python 3.3 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2011-07-13 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2012-06-24 Thread Eric Snow
Changes by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2009-07-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: In Py3.x, this fails: "%s.%s.%s-%s-%s" % sys.version_info The reason is that PyUnicode_Format() expects a real tuple, not a tuple lookalike. The fix is to either have structseq inherit from tuple or to modify PyUnicode_Format() to handle structseq:

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2009-07-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Raymond Hettinger wrote: > Raymond Hettinger added the comment: > > In Py3.x, this fails: > "%s.%s.%s-%s-%s" % sys.version_info > > The reason is that PyUnicode_Format() expects a real tuple, not a tuple > lookalike. The fix is to either have structs

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2009-07-13 Thread Georg Brandl
Georg Brandl added the comment: ISTM that structseq should have been a tuple subclass anyway. Isn't it advertised as some sort of "tuple with attribute access"? -- ___ Python tracker __

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2009-07-26 Thread Ori Avtalion
Changes by Ori Avtalion : -- nosy: +salty-horse ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2009-07-26 Thread Ori Avtalion
Ori Avtalion added the comment: For those who missed it, the patch that was committed in r59967 was quickly reverted in r59970 with the comment: "Temporarily revert 59967 until GC can be added." Raymond, can you please explain what was missing from the patch? -- _

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2013-06-25 Thread Eric Snow
Eric Snow added the comment: Would we also want to implement _make(). -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2013-07-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: Unassigning until another patch arrives that moves this forward. The basic idea is well established: Get the structseq API to match the named tuple API as much as possible. -- assignee: rhettinger -> components: +Extension Modules -Interpreter Cor

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2009-01-02 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- versions: +Python 2.7, Python 3.1 -Python 2.6, Python 3.0 ___ Python tracker ___ ___ Python-bugs-list

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2009-02-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: See also issue 2308 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2009-04-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Jack, do you have any interest in putting this one over the goal line? -- assignee: rhettinger -> jackdied nosy: +jackdied ___ Python tracker ___