def numeric_collator():
 global _numeric_collator
 if (_numeric_collator is None):
  _numeric_collator = collator().clone()
  _numeric_collator.strength = _icu.UCOL_SECONDARY
  _numeric_collator.numeric = True
 return _numeric_collator

def numeric_collator ( ) : global _numeric_collator if ( _numeric_collator is None ) : _numeric_collator = collator ( ) . clone ( ) _numeric_collator . strength = _icu . UCOL_SECONDARY _numeric_collator . numeric = True return _numeric_collator
uses natural sorting for numbers inside strings so something2 will sort before something10 .