Python3: sorting image objects according to a cmp function

P

Poor Yorick

I'm looking for a Python3-compatible way to sort a list of PIL image objects
based on a computed difference between the two images. In 2.x, this would
work:

imagelist.sort(cmp=image_diff(a,b))

Maybe this could be done by creating a new class with the appropriate __lt__,
____gt__, __eq__ methods, but that seems like more work than should be
necessary. Any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top