[issue22687] horrible performance of textwrap.wrap() with a long word

2014-10-21 Thread Ben Roberts
Changes by Ben Roberts : -- nosy: +roippi ___ Python tracker <http://bugs.python.org/issue22687> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-10-03 Thread Ben Roberts
Ben Roberts added the comment: That is one approach, of course, but imo pretty incomplete. A test that is named "test_get_only" presumably would be expected to test __getitem__, not __cmp__. Confusingly there is still a GetOnly item declared in the module, but it is not used.

[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-10-03 Thread Ben Roberts
Ben Roberts added the comment: Any thoughts/reviews on the patch? -- ___ Python tracker <http://bugs.python.org/issue19119> ___ ___ Python-bugs-list mailin

[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-09-21 Thread Ben Roberts
Ben Roberts added the comment: Attached patch fixes the tests. -- Added file: http://bugs.python.org/file36683/fix_heapq_tests.patch ___ Python tracker <http://bugs.python.org/issue19

[issue19119] duplicate test name in Lib/test/test_heapq.py

2014-09-21 Thread Ben Roberts
Ben Roberts added the comment: > The major issue (there are other issues as well but not so difficult) is > whether nlargest and nsmallest should support iterator that could be endless > iterator or reject it (by checking __len__ attribute) straight away. Well, failing with an except

[issue22454] Adding the opposite function of shlex.split()

2014-09-21 Thread Ben Roberts
Ben Roberts added the comment: For the record I am on board with a shlex.join. Even though the implementation is simple: - It is not obvious to many users if there are any "gotchas" by doing a ' '.join yourself, /even if/ you know that strings with spaces in them n

[issue22454] Adding the opposite function of shlex.split()

2014-09-21 Thread Ben Roberts
Ben Roberts added the comment: ' '.join(shlex.quote(x) for x in split_command) -- nosy: +roippi ___ Python tracker <http://bugs.python.org/issue22454> ___ __

[issue22192] dict_values objects are hashable

2014-09-05 Thread Ben Roberts
Ben Roberts added the comment: Going to close this down - implementing rich comparisons for values() does feel like the correct solution... but I don't think it's possible to implement __eq__ in better than nlogn time (and possibly space). So nothing can realistically be

[issue2527] Pass a namespace to timeit

2014-08-23 Thread Ben Roberts
Ben Roberts added the comment: Thanks Antoine. Cheers :-) -- ___ Python tracker <http://bugs.python.org/issue2527> ___ ___ Python-bugs-list mailing list Unsub

[issue2527] Pass a namespace to timeit

2014-08-21 Thread Ben Roberts
Ben Roberts added the comment: Ah yes. New patch improves the docs. -- Added file: http://bugs.python.org/file36432/timeit_global_arg_v2.patch ___ Python tracker <http://bugs.python.org/issue2

[issue2527] Pass a namespace to timeit

2014-08-21 Thread Ben Roberts
Ben Roberts added the comment: I did sign one right after I submitted the patch. Takes a few days for the asterisks to propagate I guess :) -- ___ Python tracker <http://bugs.python.org/issue2

[issue2527] Pass a namespace to timeit

2014-08-18 Thread Ben Roberts
Ben Roberts added the comment: Correction, the name of the argument is 'globals', not 'global'. -- ___ Python tracker <http://bugs.python.org/issue2527> ___

[issue2527] Pass a namespace to timeit

2014-08-18 Thread Ben Roberts
Ben Roberts added the comment: Attached is a patch that adds a 'global' kwarg to the Timeit constructor, which does pretty much what it says on the tin: specifies a global namespace that exec() will use. I originally had a 'locals' arg as well (to mirror the signature

[issue2527] Pass a namespace to timeit

2014-08-17 Thread Ben Roberts
Changes by Ben Roberts : -- nosy: +roippi ___ Python tracker <http://bugs.python.org/issue2527> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22192] dict_values objects are hashable

2014-08-15 Thread Ben Roberts
Ben Roberts added the comment: I have a patch with tests for this (running the test suite now) but I am increasingly unsure if python isn't doing the right thing already. Intuitively, it "feels" wrong (to me) to allow a dict_values view to be hashable since the mapping onto wh

[issue22192] dict_values objects are hashable

2014-08-13 Thread Ben Roberts
New submission from Ben Roberts: In python 3.4 these result in a TypeError: hash({}.keys()) hash({}.items()) But this succeeds: hash({}.values()) The 2.7 backports of these - viewkeys, viewitems, and viewvalues respectively - behave equivalently. See more discussion on StackOverflow