Concrete suggestions are welcome.
Which mathematical functions? The cmath or statistics modules have them a lot!
As a bit of off-topic, did you consider to have some global flag(s) to control this? E.g. gmpy2 or mpmath have a context notion. In gmpy2, where the CPython’s counterpart have ValueError for domain error — you can get either nan/inf (per C standard), or an exception, or a complex result:
>>> import gmpy2
>>> gmpy2.sqrt(-1)
mpfr('nan')
>>> gmpy2.get_context().trap_invalid=True
>>> gmpy2.sqrt(-1)
Traceback (most recent call last):
File "<python-input-4>", line 1, in <module>
gmpy2.sqrt(-1)
~~~~~~~~~~^^^^
gmpy2.InvalidOperationError: invalid operation
>>> gmpy2.get_context().allow_complex = True
>>> gmpy2.sqrt(-1)
mpc('0.0+1.0j')
I can’t add much more to Tim’s and Serhyi’s comments. My 2c:
IIUIC, the “soft deprecation” doesn’t mean we will have to keep them forever. Eventually, we can deprecate these aliases. So, I doubt that backward compatibility or maintenance burden to keep aliases are good arguments against.
How about suggested by Steve submodule, say math.ntheory? The math module holds “catch-all” role for math, but integer-specific functions will have own namespace?