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


Groups > comp.lang.python > #74218

Re: Naming conventions for functions and methods

From Ben Finney <ben@benfinney.id.au>
Subject Re: Naming conventions for functions and methods
Date 2014-07-09 09:59 +1000
References <1404831558.6942.139345801.530E4959@webmail.messagingengine.com>
Newsgroups comp.lang.python
Message-ID <mailman.11669.1404863975.18130.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web