[Numpy-discussion] adopting Python Style Guide for classes

Matthew Brett matthew.brett@gmail....
Tue Oct 2 11:59:03 CDT 2007


On 10/2/07, Christopher Barker <Chris.Barker@noaa.gov> wrote:
> 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.

Excellent plan - and I think it will make the code considerably more
readable (and writeable).

> > 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?

Both seem good.  How about implementing both for the next minor
release, with the ability to turn the deprecation warnings off?

> 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.

Sounds right to me - factory function as function, class as class.

> 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.

Matthew


More information about the Numpy-discussion mailing list