Tim Peters <t...@python.org> added the comment:

> todecstr treats it as an "input" conversion instead, ...

Worth pointing this out since it doesn't seem widely known: "input" base 
conversions are _generally_ faster than "output" ones. Working in the 
destination base (or a power of it) is generally simpler.

In the math.factorial(1000000) example, it takes CPython more than 3x longer 
for str() to convert it to base 10 than for int() to reconstruct the bigint 
from that string. Not an O() thing (they're both quadratic time in CPython 
today).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46558>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to