[issue9523] Improve dbm modules

2011-03-20 Thread Éric Araujo
Éric Araujo added the comment: I think the patch will not be suitable for 3.1 and 3.2, so there should be a doc patch to mention the limitations of the dbm API (keys() returning a list and all that). -- ___ Python tracker

[issue9523] Improve dbm modules

2011-03-21 Thread Ray.Allen
Ray.Allen added the comment: > I think the patch will not be suitable for 3.1 and 3.2 Yes, it changes some api(e.g keys()), which may introduces compatibility issues. > so there should be a doc patch to mention the limitations of the dbm API > (keys() > returning a list and all that). Do you

[issue9523] Improve dbm modules

2011-03-21 Thread Éric Araujo
Éric Araujo added the comment: Yes, I mean exactly that. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue9523] Improve dbm modules

2011-03-23 Thread Ray.Allen
Ray.Allen added the comment: Updated patch: 1, Changes follows review comments: http://codereview.appspot.com/4185044/. Thanks eric! 2, Make Objects/dictobject.c:all_contained_in() a common useful limited api Object/abstract.c:_PyObject_AllContainedIn() for the purpose of re-usage in Module

[issue9523] Improve dbm modules

2011-03-23 Thread Nick Coghlan
Changes by Nick Coghlan : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue9523] Improve dbm modules

2011-03-24 Thread Ray.Allen
Ray.Allen added the comment: I tried to work out a doc patch for 3.2 to mention the limitation api: the missing methods compared with dict and the imperfect methods(keys(), items()) of collections.MutableMapping. Here is it. -- Added file: http://bugs.python.org/file21369/issue_9523_3

[issue9523] Improve dbm modules

2011-04-20 Thread ysj.ray
ysj.ray added the comment: Updated patch following C code review comments from http://bugs.python.org/review/9523/show Two big changes: 1. Add check for each time assign a Py_ssize_t variable to datum.dsize(int), if value not fit, raise a ValueError(following PEP 353) 2. Simplify dbm.update

[issue9523] Improve dbm modules

2011-04-24 Thread ysj.ray
ysj.ray added the comment: Sorry, previous patch(issue_9523_4.diff) missed a file(Lib/test/dbm_tests.py) Here is an intact one. -- Added file: http://bugs.python.org/file21769/issue_9523_5.diff ___ Python tracker _

[issue9523] Improve dbm modules

2010-11-11 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo title: Improve dbm module -> Improve dbm modules ___ Python tracker ___ ___ Python-bugs-

[issue9523] Improve dbm modules

2010-11-11 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +Kain94, georg.brandl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue9523] Improve dbm modules

2010-12-04 Thread Éric Araujo
Éric Araujo added the comment: In 3.2, objects return by dbm.dumb.open implement MutableMapping with incorrect semantics: keys return a list, iterkeys exist, etc. -- ___ Python tracker

[issue9523] Improve dbm modules

2010-12-07 Thread Ray.Allen
Ray.Allen added the comment: Oh, yes. I noticed that the pep3119 defines return value of method MutableMapping.keys() as Set, as well as method items(). So the implementation of dumb.keys() and dump.items() are not correct since they all return lists while the class inherits MutableMapping.

[issue9523] Improve dbm modules

2010-12-07 Thread R. David Murray
R. David Murray added the comment: I believe that in the absence of other documentation the ABC is considered authoritative. -- nosy: +r.david.murray ___ Python tracker ___

[issue9523] Improve dbm modules

2010-12-09 Thread Ray.Allen
Ray.Allen added the comment: Here is the updated patch, which fixed: 1. remove get() method of gdbm since issue6045 has already add it. 2. method keys() and items() of dbm object return set instead of list. Since pep3119 said keys() and items() should return collections.Set and set is a coll

[issue9523] Improve dbm modules

2011-02-03 Thread Éric Araujo
Éric Araujo added the comment: Thank you for working on a patch, especially with such comprehensive tests. > The object returned by :func:`.open` supports the same basic functionality as > -dictionaries > +:mod:`collection`.MutableMapping The previous text was okay, I wouldn’t have changed it.

[issue9523] Improve dbm modules

2011-02-03 Thread Éric Araujo
Éric Araujo added the comment: See #5736 for a patch adding iteration support. If the patch attached to his report supersedes the other one, I’ll close the other bug as duplicate. -- ___ Python tracker __

[issue9523] Improve dbm modules

2011-02-10 Thread Ray.Allen
Ray.Allen added the comment: Thanks eric for reviewing my patch! And thanks for you suggestions. I'm following them. > I don’t know if you should use a plain set or a collections.ItemsView here. > In dict objects, KeysView and ValuesView are set-like objects with added > behavior, for exam

[issue9523] Improve dbm modules

2011-02-10 Thread Éric Araujo
Éric Araujo added the comment: > 1. Make keys(), values(), items() methods return view object for > ndbm, gdbm and dumb objects. I following the codes in dictobject.c. Did you have to copy the code? Isn’t it possible to somehow reuse it? > The keysview object support len(), "in" operator, and

[issue9523] Improve dbm modules

2011-02-12 Thread Ray.Allen
Ray.Allen added the comment: > > 1. Make keys(), values(), items() methods return view object for ndbm, gdbm > > and dumb objects. I following the codes in dictobject.c. > Did you have to copy the code? Isn’t it possible to somehow reuse it? I feel not so easy to reuse the code, there could b

[issue9523] Improve dbm modules

2011-02-12 Thread Ray.Allen
Changes by Ray.Allen : Added file: http://bugs.python.org/file20751/issue_9523.diff ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue9523] Improve dbm modules

2011-02-12 Thread Éric Araujo
Éric Araujo added the comment: > Add rich compare functions and disjoint() method to dbm view objects > to make them as MappingView objects, and add abc registration for them. I’d prefer you not to register them, but test isinstance(keys(), KeysView), so that we’re sure no method is missing. (

[issue9523] Improve dbm modules

2011-02-12 Thread Éric Araujo
Éric Araujo added the comment: Closed #5736 as superseded. Please make sure the comments there about the peculiar API of gdbm don’t come up or are addressed in your patch. -- ___ Python tracker __

[issue9523] Improve dbm modules

2011-02-13 Thread Ray.Allen
Changes by Ray.Allen : Removed file: http://bugs.python.org/file18402/issue8634.diff ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue9523] Improve dbm modules

2011-02-13 Thread Ray.Allen
Changes by Ray.Allen : Removed file: http://bugs.python.org/file19987/issue_9523.diff ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue9523] Improve dbm modules

2011-02-13 Thread Ray.Allen
Changes by Ray.Allen : Removed file: http://bugs.python.org/file20726/issue_9523.diff ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue9523] Improve dbm modules

2011-02-16 Thread Ray.Allen
Ray.Allen added the comment: Thanks! Here is my updated patch: 1, Now the dbm view objects are the same as dict view objects, which are in conformity with collections.KeysView, ValuesView and ItemsView. 2, I register all these abcs explicitly because these abcs have not __subclasshook__() met

[issue9523] Improve dbm modules

2011-02-16 Thread Ray.Allen
Changes by Ray.Allen : Removed file: http://bugs.python.org/file20751/issue_9523.diff ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue9523] Improve dbm modules

2011-02-16 Thread Éric Araujo
Éric Araujo added the comment: > Here is my updated patch: You don’t have to attach a file here, just update the codereview page instead. Or maybe you can’t because I created the page? > 1, Now the dbm view objects are the same as dict view objects, which > are in conformity with collections.

[issue9523] Improve dbm modules

2011-02-18 Thread Ray.Allen
Ray.Allen added the comment: An updated patch, based on latest several reviews on http://codereview.appspot.com/4185044/ update: 1, Refactoring the common tests between test_dbm_gnu and test_dbm_ndbm. 2, Move the abc registering in Lib/dbm/ndbm.py and Lib/dbm/gnu.py. 3, Other changes pointed o

[issue9523] Improve dbm modules

2011-02-18 Thread Ray.Allen
Changes by Ray.Allen : Removed file: http://bugs.python.org/file20771/issue_9523.diff ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue9523] Improve dbm modules

2011-02-21 Thread Ray.Allen
Ray.Allen added the comment: Sine r88451 removed unittest's assertSameElements() method, I need to updated my patch to fit it. So here it is. -- Added file: http://bugs.python.org/file20832/issue9523.diff ___ Python tracker

[issue9523] Improve dbm modules

2011-02-21 Thread Ray.Allen
Changes by Ray.Allen : Removed file: http://bugs.python.org/file20783/issue_9523.diff ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue9523] Improve dbm modules

2011-11-09 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o