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

2020-01-15 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2020-01-01 Thread Raymond Hettinger
Change by Raymond Hettinger : -- versions: +Python 3.9 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2020-01-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- pull_requests: -17214 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2020-01-01 Thread Vinay Sajip
Change by Vinay Sajip : -- pull_requests: +17214 pull_request: https://github.com/python/cpython/pull/17773 ___ Python tracker ___

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

2019-08-08 Thread Philip Dye
Change by Philip Dye : -- nosy: +Philip Dye ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2016-10-03 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: needs patch -> patch review versions: +Python 3.7 -Python 3.5 ___ Python tracker

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

2014-10-14 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: -skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___ Python-bugs-list

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

2014-06-29 Thread Stefan Krah
Stefan Krah added the comment: Andrew, thanks for signing the agreement! [Sunny] Is this what you expect? I find the initialization in os.stat_result somewhat strange. Also, a certain use of unnamed fields that worked in 2.5 is now broken, which we should sort out before proceeding any

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

2014-06-11 Thread Andrew Barnert
Andrew Barnert added the comment: Hi, Stephan. Sorry, for some reason Yahoo was sending updates from the tracker to spam again, so I missed this. I'd be glad to sign a contributor agreement if it's still relevant, but it looks like there's a later patch that does what mine did and more?

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

2014-06-11 Thread Andrew Barnert
Andrew Barnert added the comment: Sorry, Stefan, not Stephan. Anyway, I've signed the agreement. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___

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

2014-05-30 Thread Sunny K
Sunny K added the comment: Hi Stefan, There is a comment at the top in structseq.c /* Fields with this name have only a field index, not a field name. They are only allowed for indices n_visible_fields. */ char *PyStructSequence_UnnamedField = unnamed field; This is the definition of

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

2014-05-30 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___

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

2014-05-28 Thread Stefan Krah
Stefan Krah added the comment: Sunny, is there a definition of visible positional fields? Currently, it seems to me that in os.stat_result we have the opposite problem, namely visible non-positional fields: For example, st_atime_ns is visible but not indexable: os.stat_result(st_mode=33188,

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

2014-05-26 Thread Sunny K
Sunny K added the comment: Hi Stefan, I've added a new patch which only adds _fields, combining parts from my earlier patch and Andrew's (his patch does not account for visible unnamed fields). -- Added file: http://bugs.python.org/file35367/structseq_fields.patch

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

2014-05-24 Thread Stefan Krah
Stefan Krah added the comment: Hi Andrew. Did you by any chance sign the contributor agreement? [It's perfectly okay if you don't want to, but then we cannot use the patch from #20230.] -- ___ Python tracker rep...@bugs.python.org

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

2014-04-29 Thread Stefan Krah
Stefan Krah added the comment: Okay, if no one else wants this, I'll go ahead with the _fields part. Andrew, could you sign a contributor agreement? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820

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

2014-04-28 Thread Stefan Krah
Stefan Krah added the comment: Is accessing _fields a common operation? Personally I'd use a PyGetSetDef and generate the tuple on access (perhaps cache the result). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820

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

2014-04-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Is accessing _fields a common operation? Not common at all -- it is used for introspection. That said, there is nearly zero savings from generating the tuple upon look-up. I would say that using a PyGetSetDef is a false optimization. --

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

2014-04-27 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___ Python-bugs-list

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

2014-04-27 Thread Stefan Krah
Stefan Krah added the comment: 1. _asdict() returns a normal dictionary. I don't know if this is what is required. Good question. I don't think we can import OrderedDict from collections because of the impact on startup time (_collections_abc was created to avoid the issue for

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

2014-04-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: any chance of the easy (_fields) change being committed and putting off the harder parts until later? Yes, it is not an all-or-nothing exercise. 1. _asdict() returns a normal dictionary. I don't know if this is what is required. A regular dict

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

2014-01-12 Thread Andrew Barnert
Andrew Barnert added the comment: See issue20230, which includes a patch implementing just the first part of part 2 (adding _fields, but not _asdict or _replace). Since this one has been open for 5+ years, if it's not going to be done soon, any chance of the easy (_fields) change being

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

2014-01-12 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___ Python-bugs-list

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

2013-11-07 Thread Sunny K
Sunny K added the comment: New patch for 3.4 adds the following: 1. _fields 2. _replace() 3. _asdict() 4. eval(repr(s)) == s Now the issues: 1. _asdict() returns a normal dictionary. I don't know if this is what is required. 2. Both _asdict() and _replace() assume that unnamed visible

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

2013-11-07 Thread Sunny K
Sunny K added the comment: Oops, the correct issue for improving the repr is issue11698. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___

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

2013-09-25 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___

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

2013-09-24 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___ Python-bugs-list

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

2013-09-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: See also #5907. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___ Python-bugs-list mailing

[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

[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 rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___

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

2012-06-24 Thread Eric Snow
Changes by Eric Snow ericsnowcurren...@gmail.com: -- nosy: +eric.snow ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___ Python-bugs-list

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

2011-07-13 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___ Python-bugs-list

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

2011-04-16 Thread Santoso Wijaya
Changes by Santoso Wijaya santoso.wij...@gmail.com: -- versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___

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

2011-04-08 Thread Santoso Wijaya
Changes by Santoso Wijaya santoso.wij...@gmail.com: -- nosy: +santa4nt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___ Python-bugs-list

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

2011-04-08 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com 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

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

2011-04-08 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Also see issue 11698 -- assignee: jackdied - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___

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

2011-04-08 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Hasn't this been fixed in the following changeset? changeset: 43509:384f73a104e9 user:Benjamin Peterson benja...@python.org date:Wed Jul 07 20:54:01 2010 + summary: make struct sequences subclass

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

2011-04-08 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com 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

2010-08-24 Thread Geoffrey Bache
Changes by Geoffrey Bache gjb1...@users.sourceforge.net: -- nosy: +gjb1002 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___

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

2010-08-09 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu 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 rep...@bugs.python.org

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

2010-08-09 Thread Eric Smith
Eric Smith e...@trueblade.com 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

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

2010-08-09 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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 rep...@bugs.python.org

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

2010-07-07 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org 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 rep...@bugs.python.org

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

2010-06-02 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___

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

2010-04-29 Thread Eric Smith
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___ Python-bugs-list mailing

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

2010-04-29 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: See also issue 8413, which would be addressed by this change. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___

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

2010-04-29 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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:

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

2009-07-26 Thread Ori Avtalion
Changes by Ori Avtalion o...@avtalion.name: -- nosy: +salty-horse ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___ Python-bugs-list

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

2009-07-26 Thread Ori Avtalion
Ori Avtalion o...@avtalion.name 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

2009-07-13 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Raymond Hettinger wrote: Raymond Hettinger rhettin...@users.sourceforge.net 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

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

2009-07-13 Thread Georg Brandl
Georg Brandl ge...@python.org 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 rep...@bugs.python.org

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

2009-07-12 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net 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

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

2009-04-01 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Jack, do you have any interest in putting this one over the goal line? -- assignee: rhettinger - jackdied nosy: +jackdied ___ Python tracker rep...@bugs.python.org

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

2009-02-10 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: See also issue 2308 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___ ___

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

2009-01-02 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- versions: +Python 2.7, Python 3.1 -Python 2.6, Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1820 ___

[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] http://bugs.python.org/issue1820 __

[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] http://bugs.python.org/issue1820 __ ___ Python-bugs-list

[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] http://bugs.python.org/issue1820 __ ___ Python-bugs-list mailing list Unsubscribe:

[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] http://bugs.python.org/issue1820

[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] http://bugs.python.org/issue1820 __ ___

[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,

[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: