[PYTHON MATRIX-SIG] Modules and Naming issues

Michael McLay mclay@eeel.nist.gov
Fri, 6 Sep 1996 14:31:50 GMT


Jim Hugunin writes:
 > 
 > My question for everyone is what should the reccommended usage of these
 > functions be?
 > 
 > I've finally gotten used to typing things like:
 > 
 > >>> Numeric.array([1,2,3], Numeric.Float32)
 > 
 > I can't imagine ever getting used to typing:
 > 
 > >>> Numeric.LinearAlgebra.inverse(a)
 > 
 > Is there something I'm missing here? 

from Numeric import LinearAlgebra

and then if you want to save lots of typing add the line

	LA = LinearAlgebra
	LA.inverse(a)

or possibly 

	import Numeric.LinearAlgebra ; LA = Numeric.LinearAlgebra


While this notation will preserve unique within the module, it may get
messy if lots of modules are imported into a single file.  It would be
helpful to have a consistent abbreviation convension.  Maybe the
preferred abbreviation should be included in the docstring.  While
this notation isn't idea it is better than having the standard useage
deteriorate to:

	from Numeric import *
	inverse(a)

Michael

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================