◐ Shell
clean mode source ↗

Fix plural form for `intword` and improve performance by dangillet · Pull Request #273 · python-humanize/humanize

python -m timeit -n 10000 -s "from humanize import intword" 'for a in (1_000_000, 3_500_000, 1_000_000_000, 1_200_000_000, 1_000_000_000_000, 6_700_000_000_000, "1_000", "12_400", "12_490", "1_000_000", "-1_000_000", "1_200_000", "1_290_000", "999_999_999", "1_000_000_000", "-1_000_000_000", "2_000_000_000", "999_999_999_999", "1_000_000_000_000", "6_000_000_000_000", "-6_000_000_000_000", "999_999_999_999_999", "1_000_000_000_000_000", "1_300_000_000_000_000", "-1_300_000_000_000_000", "3_500_000_000_000_000_000_000", "8_100_000_000_000_000_000_000_000_000_000_000", "-8_100_000_000_000_000_000_000_000_000_000_000", "-8.1 quintilliards", 1_000_000_000_000_000_000_000_000_000_000_000_000, 1_100_000_000_000_000_000_000_000_000_000_000_000, 2_100_000_000_000_000_000_000_000_000_000_000_000): intword(a)'
Found existing alias for "python". You should use: "p"
10000 loops, best of 5: 42 usec per loop
python -m timeit -n 10000 -s "from humanize import intword" 'for a in (1_000_000, 3_500_000, 1_000_000_000, 1_200_000_000, 1_000_000_000_000, 6_700_000_000_000, "1_000", "12_400", "12_490", "1_000_000", "-1_000_000", "1_200_000", "1_290_000", "999_999_999", "1_000_000_000", "-1_000_000_000", "2_000_000_000", "999_999_999_999", "1_000_000_000_000", "6_000_000_000_000", "-6_000_000_000_000", "999_999_999_999_999", "1_000_000_000_000_000", "1_300_000_000_000_000", "-1_300_000_000_000_000", "3_500_000_000_000_000_000_000", "8_100_000_000_000_000_000_000_000_000_000_000", "-8_100_000_000_000_000_000_000_000_000_000_000", "-8.1 quintilliards", 1_000_000_000_000_000_000_000_000_000_000_000_000, 1_100_000_000_000_000_000_000_000_000_000_000_000, 2_100_000_000_000_000_000_000_000_000_000_000_000): intword(a)'
Found existing alias for "python". You should use: "p"
10000 loops, best of 5: 35.3 usec per loop

---

This also