Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74218 > unrolled thread

Re: Naming conventions for functions and methods

Started byBen Finney <ben@benfinney.id.au>
First post2014-07-09 09:59 +1000
Last post2014-07-09 09:59 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Naming conventions for functions and methods Ben Finney <ben@benfinney.id.au> - 2014-07-09 09:59 +1000

#74218 — Re: Naming conventions for functions and methods

FromBen Finney <ben@benfinney.id.au>
Date2014-07-09 09:59 +1000
SubjectRe: Naming conventions for functions and methods
Message-ID<mailman.11669.1404863975.18130.python-list@python.org>
python@bdurham.com writes:

> Looking for your opinions on how you name your functions and
> methods. Example: I have a function that hashes a file. I could
> name this function hash_file() or file_hash().

I'd prefer just ‘hash’. The function name can be considered an action
verb, with its arguments as the objects acted upon.

-- 
 \     “Nothing worth saying is inoffensive to everyone. Nothing worth |
  `\    saying will fail to make you enemies. And nothing worth saying |
_o__)            will not produce a confrontation.” —Johann Hari, 2011 |
Ben Finney

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web