pulp/pulp_rpm — pull request #166 by jdob (2013-04-03 18:08:38+00:00)
Title: RPM version/release encoding algorithm

The code looks different than in the deep dive. I simplified the steps by doing the subsegment splitting (1alpha -> 1.alpha) at the start and then acting on each segment after that. I added the leading zero and exception handling on the off chance we get a >99 character version.

I was tempted to leave encode() as:
return '.'.join(map(_encode_subsegment, reduce(_split_subsegments, field).split('.')))

I opted for a more readable separation instead. :)