[Numpy-discussion] adopting Python Style Guide for classes

Christopher Barker Chris.Barker@noaa....
Tue Oct 2 11:52:14 CDT 2007


Jarrod Millman wrote:
> I am hoping that most of you agree with the general principle of
> bringing NumPy and SciPy into compliance with the standard naming
> conventions. 

+1

> 3.  When we release NumPy 1.1, we will convert all (or almost all)
> class names to CapWords.  

What's the backwards-compatible plan?

- keep the old names as aliases?
- raise deprecation warnings?

What about factory functions that kind of look like they might be 
classes -- numpy.array() comes to mind. Though maybe using CamelCase for 
the real classes will help folks understand the difference.

What is a "class" in this case -- with new-style classes, there is no 
distinction between types and classes, so I guess they are all classes, 
which means lots of things like:

numpy.float32

etc. etc. etc. are classes. should they be CamelCase too?

NOTE:
for i in dir(numpy):
      if type(getattr(numpy, i)) == type(numpy.ndarray): print i

Yields 86 type objects.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov


More information about the Numpy-discussion mailing list