This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

cmpGen is deprecated. Please just use the “key” parameter of sort/sorted instead. It is better in every conceivable way (faster, simpler, more legible, etc.)

For example, here is the example below, but entirely using “key” instead:

l=[3,0,1,-2,4,3,-5] l.sort(key=abs) l now is [0,1,-2,3,3,4,-5]

This pakage is now here just to support legacy version of packages that used this

Old README for reference:

cmpGen is a very simple utility to aid in sorting. Basically, I often want to sort a list based on a specific property or more generically a function of the values in the list. cmpGen acts as a middle layer to make this process simple.

Usage: l is a list l.sort(cmpGen(someFunctionThatActsOnListElements))

Example 1: Sort a list of 2-integer pairs based on second element in the pair: l=[[3,3],[1,6],[0,12],[1,1],[7,4],[6,7]] l.sort(cmpGen(lambda x: x[1])) l is now [[1, 1], [3, 3], [7, 4], [1, 6], [6, 7], [0, 12]]

Example 2: Sort based on the absolute value of list elements: l=[3,0,1,-2,4,3,-5] l.sort(cmpGen(abs)) l now is [0,1,-2,3,3,4,-5]

Release History

Release History

0.1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
cmpGen-0.1.2.tar.gz (1.6 kB) Copy SHA256 Checksum SHA256 Source Apr 29, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting