[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-22 Thread Ramchandra Apte
Ramchandra Apte added the comment: @Raymond Hettinger Why? Please respond to my comments. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17001 ___

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-21 Thread Ramchandra Apte
Ramchandra Apte added the comment: Performance info using the attached program: ~2.5 sec, original ~3.5 sec, patched (patched version is 40% slower) Is anybody doing the comparison in performance-critical cases? -- ___ Python tracker

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-21 Thread Ramchandra Apte
Ramchandra Apte added the comment: On 21 January 2013 02:42, Raymond Hettinger rep...@bugs.python.org wrote: NotImplemented Can you please elaborate on it doesn't handle the NotImplemented logic very well. AFAIK both will give NotImplemented for the same values. --

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-21 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17001 ___

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Ramchandra Apte
Changes by Ramchandra Apte maniandra...@gmail.com: Removed file: http://bugs.python.org/file28794/issue-v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17001 ___

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Ramchandra Apte
Ramchandra Apte added the comment: Oh darn, I included another bugs changes in it. I unlinked the v2 patch and have attached issue17001-v2.patch -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17001

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Except for mistakenly included functional.rst changes, the patch looks good for me. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17001

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: I recommend against this patch. The code generated by functools.total_ordering is less efficient than the existing code and it doesn't handle the NotImplemented logic very well. total_ordering() is a shortcut, not a best practice. -- nosy:

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-19 Thread Ramchandra Apte
New submission from Ramchandra Apte: This would reduce the complexity of uuid.UUID and also if the way it compares changes, one would't have to change all the compare methods. Attached is a patch. -- components: Library (Lib) files: issue.patch keywords: patch messages: 180275 nosy:

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-19 Thread Ramchandra Apte
Changes by Ramchandra Apte maniandra...@gmail.com: -- type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17001 ___ ___

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-19 Thread Brian Curtin
Brian Curtin added the comment: Can you provide test cases for this code? -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17001 ___

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-19 Thread Ramchandra Apte
Ramchandra Apte added the comment: Yes, will do so. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17001 ___ ___ Python-bugs-list mailing list

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-19 Thread Ramchandra Apte
Ramchandra Apte added the comment: @Brian Curtin It appears that there are tests for UUID ordering. [0] I will run the tests. [0] http://hg.python.org/cpython/file/d1e6a48dfb0d/Lib/test/test_uuid.py#l188 -- ___ Python tracker rep...@bugs.python.org

[issue17001] Make uuid.UUID use functools.total_ordering

2013-01-19 Thread Ramchandra Apte
Ramchandra Apte added the comment: Damn, I forgot to add import functools. Here is a fixed version that passes test_uuid. -- Added file: http://bugs.python.org/file28794/issue-v2.patch ___ Python tracker rep...@bugs.python.org