Interestingly, the function terminates gracefully when the first argument is infinity...
Python 3.6.8 (default, Oct 7 2019, 12:59:55)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mpmath import *
>>> import numpy as np
>>> mp.polylog(np.inf, 2.2)
mpc(real='nan', imag='nan')
>>> mp.polylog(np.NINF, 2.2)
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/mpmath/ctx_mp_python.py", line 1035, in f_wrapped
retval = f(ctx, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mpmath/functions/zeta.py", line 485, in polylog
return polylog_general(ctx, s, z)
File "/usr/local/lib/python3.6/dist-packages/mpmath/functions/zeta.py", line 462, in polylog_general
t /= k
File "<string>", line 3, in __div__
KeyboardInterrupt
>>> mp.polylog(np.nan, 2.2)
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/mpmath/ctx_mp_python.py", line 1035, in f_wrapped
retval = f(ctx, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/mpmath/functions/zeta.py", line 485, in polylog
return polylog_general(ctx, s, z)
File "/usr/local/lib/python3.6/dist-packages/mpmath/functions/zeta.py", line 461, in polylog_general
t *= u
File "<string>", line 7, in __mul__
KeyboardInterrupt
mpmath version: 1.1.0
A hang is caused in four cases:
Interestingly, the function terminates gracefully when the first argument is infinity...