def _col_name(index):
for exp in itertools.count(<NUM_LIT:1>):<EOL><INDENT>limit = <NUM_LIT> ** exp<EOL>if index < limit:<EOL><INDENT>return '<STR_LIT>'.join(chr(ord('<STR_LIT:A>') + index // (<NUM_LIT> ** i) % <NUM_LIT>) for i in range(exp-<NUM_LIT:1>, -<NUM_LIT:1>, -<NUM_LIT:1>))<EOL><DEDENT>index -= limit<EOL><DEDENT>
Converts a column index to a column name.

>>> _col_name(0)
'A'
>>> _col_name(26)
'AA'