UFL

Do not use cmp for sorting lists and dictionaries

Bug #1094909 reported by Garth Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UFL
Fix Released
Medium
Martin Sandve Alnæs

Bug Description

cmp has been removed from Python 3. To be ready for the change, UFL should not use cmp, but should implement __lt__ and __eq__.

Changed in ufl:
milestone: none → 1.1.0-alpha
Revision history for this message
Martin Sandve Alnæs (martinal) wrote :

Fixed. (__cmp__ was only implemented in graph.py, which is only used by sfc afaik, and will be removed at some point in the future since uflacs has does these things better).

Changed in ufl:
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Martin Sandve Alnæs (martinal)
Revision history for this message
Martin Sandve Alnæs (martinal) wrote :

I only fixed the __cmp__ use, working on other cmp() uses. Not much.

Revision history for this message
Garth Wells (garth-wells) wrote : Re: [Bug 1094909] Re: Do not use cmp for sorting lists and dictionaries

Once we get Python components Python 3 compatible, we should add
something to the buildbots to make sure we don't undo the Python 3
compatibility.

Garth

On Wed, Jan 2, 2013 at 10:04 AM, Martin Sandve Alnæs
<email address hidden> wrote:
> I only fixed the __cmp__ use, working on other cmp() uses. Not much.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1094909
>
> Title:
> Do not use cmp for sorting lists and dictionaries
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ufl/+bug/1094909/+subscriptions

Revision history for this message
Martin Sandve Alnæs (martinal) wrote :

What's the minimum python version we need to support? The buildbots have 2.6, which does not have the functools.cmp_to_key helper function to ease the trasition to the removal of cmp.

Changed in ufl:
status: Fix Committed → In Progress
Revision history for this message
Martin Sandve Alnæs (martinal) wrote :

Should be fixed now, but this is a bit hard to know... I bet there are other latent issues in the python 3 changes as well. Also, these changes will probably reduce performance somewhat as I had to construct a proxy key object for each comparison, which happens quite often.

Changed in ufl:
status: In Progress → Fix Committed
Changed in ufl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.