[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-08-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed in r84252, r84252, and r84254. -- priority: high -> normal resolution: accepted -> fixed status: open -> closed ___ Python tracker ___

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-08-20 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: The patch looks good to me, too. The new tests fail without the fix, and pass with the fix. -- assignee: stutzbach -> rhettinger stage: unit test needed -> patch review ___ Python tracker

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-31 Thread Daniel Urban
Daniel Urban added the comment: > P.S. Please let me know how to detect such issues in future patches. In some editors there is an option "Remove trailing spaces" or something like that. Also, some editors (for example Kate) show trailing spaces. -- __

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-30 Thread Eli Bendersky
Eli Bendersky added the comment: Attaching an updated patch, with the trailing whitespace removed. Hope it's more acceptable now. P.S. Please let me know how to detect such issues in future patches. -- Added file: http://bugs.python.org/file18267/issue9214.2.patch ___

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-29 Thread Daniel Urban
Daniel Urban added the comment: The patch applies cleanly to the py3k branch (r83238). The unittests pass. The code looks good to me (it does exactly what was described as the solution). There are some trailing whitespace on some lines, that will need to be deleted. -- nosy: +durban

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-25 Thread Eli Bendersky
Eli Bendersky added the comment: Hello, I'm attaching a patch for this issue. 1. _from_iterable in KeysView and ItemsView overridden as per Daniel's suggestion (Lib/_abcoll.py) 2. Added a test case to Lib/test/test_collections.py that uses this test case (creates the subclass and attempts m

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-16 Thread Eli Bendersky
Changes by Eli Bendersky : -- nosy: +eli.bendersky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-10 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +merwok ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-10 Thread Éric Araujo
Changes by Éric Araujo : -- resolution: -> accepted ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: > To solve the problem, KeysView and ItemsView need > to override _from_iterable to return a set instead > of a new view. Thanks for the good analysis and suggested fix. I believe both are correct and they match the behavior of real dictionaries. def

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-09 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-09 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: I guess roundup is deleting my linefeed? I'm sure I didn't do it that time. I'm not sure what's going on there, but the "x['blue'] = 7" should be on a line by itself. -- ___ Python tracker

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-09 Thread Daniel Stutzbach
Daniel Stutzbach added the comment: Oops. Somehow deleted a linefeed in there. The example should read: x = MySimpleMapping(red=5) y = x.keys() z = x.keys() | {'orange'} x['blue'] = 7 print(list(z)) print(list(z)) -- ___

[issue9214] Most Set methods of KeysView and ItemsView do not work right

2010-07-09 Thread Daniel Stutzbach
New submission from Daniel Stutzbach : Attached is a simple Python 3 example script that defines a minimalist MutableMapping that simply wraps a dict, followed by: x = MySimpleMapping(red=5) y = x.keys() z = x.keys() | {'orange'} x['blue'] = 7 print(list