gamma approximation : what is module cmath and where is it located ?

Dave Angel davea at ieee.org
Thu Jul 30 09:53:31 EDT 2009


pdlemper at earthlink.net wrote:
> from cmath import *
>  
> <snip>
> What is cmath, where did it come from and how does it differ from
> the standard math module  ?
>
> Dave WB3DWE
>                                    I saw the number 4 in silver,  Guido
>                                      (apologies to Wm Carlos Williams)
>
>   

I'm surprised that with all the responses, nobody has pointed out the 
dangers involved in using
     from cmath import *

In general, this form of import is discouraged.   I presume there's no 
problem if you're not also importing 'math' and all your calls are 
intending to be for the complex versions.  But if you're mixing things 
up, consider using the more conventional
     import  cmath

and using cmath.   as a prefix before the function calls.

DaveA




More information about the Python-list mailing list