Задать вопрос

Тел: +7 965 3737 888

490

Просмотров

1

Ответов

Localized digits (re)

Another one like 980, but using re's instead.

I haven't benchmarked these, but my guess is that 981 is faster for strings of pure digits and this is faster for larger chunks of text that happen to contain digits. If you're generating the numbers yourself, I'd just use 981 on a number right when you generate it.

Вопрос полезен? Да0/Нет0
file_4584.py(1.0Кб)
None

Ответы (1):

Ответjcassee:18.08.2008
Ответ полезен? Да0/Нет0

Nice to see your updates to snippet 980! I had just updated my version to regular expressions, when I saw your version. Maybe we could integrate our ideas into 'the one true i18n_digits snippet'?