[Python-Dev] Changes to PEP 327: Decimal data type

Robert Brewer fumanchu at amor.org
Wed Mar 17 16:23:44 EST 2004


Michael Chermside wrote:
> Oren writes:
> > >     Decimal.fromFloat(floatNumber, positions)
> > 
> > +1 on the behavior. One nitpick about the method name: this 
> caseConvention 
> > is not consistent with the Python Style Guide (PEP 8)
> 
> It _IS_ consistant as I read it:
> 
> >     Function Names
> > 
> >       Plain functions exported by a module can either use 
> the CapWords
> >       style or lowercase (or lower_case_with_underscores).  There is
> >       no strong preference, but it seems that the CapWords style is
> >       used for functions that provide major functionality
> >       (e.g. nstools.WorldOpen()), while lowercase is used more for
> >       "utility" functions (e.g. pathhack.kos_root()).
> 
> I interpret that to mean that CapWords (fromFloat) is a 
> perfectly valid 
> style for method names. If I'm mis-interpreting it, please 
> let me know.

Only that CapWords in PEP 8 seems to be distinct from mixedCase, where
the first character is lowercase (I think that's what Oren meant). So
"fromFloat" (mixedCase) should be "FromFloat" (CapWords) or "from_float"
(lower_case_with_underscores).

However, you're bang on about rampant deviation. Probably too late in
the game to do anything about it with existing core code. :(


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org



More information about the Python-Dev mailing list