On 3/12/2011 2:09 PM, Terry Reedy wrote:
I believe that if the integer field were padded with leading blanks as needed so that all are the same length, then no key would be needed.

Did you mean that "if the integer field were" converted to string and "padded with leading blanks..."?

Otherwise I'm not sure how to pad an integer with leading blanks.

Also, what appears to be your revised data structure, strval + ',' + '%5.5d' % intval , assumes the strval is fixed length, also. Consider the following strval, intval pairs, using your syntax:

['a,997,    1','a, 1000']

Nothing says the strval wouldn't contain data that look like your structure... and just because they were short, didn't mean they were fixed length.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to