method names nounVerb or verbNoun

Gerald Britton gerald.britton at
Fri Feb 5 21:00:45 CET 2010

On Fri, Feb 5, 2010 at 2:53 PM, Wanderer <wanderer at> wrote:
> Which is the more accepted way to compose method names nounVerb or
> verbNoun?
> For example voltageGet or getVoltage? getVoltage sounds more normal,
> but voltageGet is more like voltage.Get. I seem to mix them and I
> should probably pick one way and stick with it.
> Thanks
> --

I'd say noun_verb (note the underscore in accordance with the style
guide in PEP 8):

Function Names

      Function names should be lowercase, with words separated by underscores
      as necessary to improve readability.

      mixedCase is allowed only in contexts where that's already the
      prevailing style (e.g., to retain backwards compatibility.

Gerald Britton

More information about the Python-list mailing list