Eric Firing <efiring@...229...> writes:

1) Present: always be explicit: npy.sin or ma.sin or math.sin or

cmath.sin. [...]2) Pick a set of math symbols that may be imported directly from numpy

at the top, and either import all routinely, or import as needed.

There's also an option that might be labeled 1a: import the necessary

symbols in the function where they are used:

def foobar():

from math import pi, sin, cos

from numpy import arange, ones, zeros

# ...

This has the advantage that the documentation on what every symbol means

is close to the code that uses the symbols, and the disadvantage of

being slower because every call of the function causes a new import.

This may or may not matter, depending on how often the function is

called.

## ···

--

Jouni K. Sepp�nen