[Numpy-discussion] adopting Python Style Guide for classes

Francesc Altet faltet at carabos.com
Tue Oct 2 13:22:41 EDT 2007


A Tuesday 02 October 2007, Robert Kern escrigué:
> Matthew Brett wrote:
> > On 10/2/07, Christopher Barker <Chris.Barker at noaa.gov> wrote:
> >> 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?
> >
> > I would vote for CamelCase in this case too.
>
> I would prefer to leave them as they are. While they are implemented
> as classes, they're usually used as data. Also, they are more similar
> to builtin types than classes one might write, and Python itself has
> a convention of leaving these lowercase (e.g. int, float, etc.).

I would prefer to leave them as they are now too.  In addition to what 
Robert is saying, they are very heavily used in regular NumPy programs, 
and changing everything (both in code and docs) would be rather messy.

Cheers,

-- 
>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"



More information about the NumPy-Discussion mailing list