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


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

Re: Naming conventions for functions and methods

Started byArnaud Delobelle <arnodel@gmail.com>
First post2014-07-08 19:31 +0100
Last post2014-07-08 19:31 +0100
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 Arnaud Delobelle <arnodel@gmail.com> - 2014-07-08 19:31 +0100

#74198 — Re: Naming conventions for functions and methods

FromArnaud Delobelle <arnodel@gmail.com>
Date2014-07-08 19:31 +0100
SubjectRe: Naming conventions for functions and methods
Message-ID<mailman.11650.1404844289.18130.python-list@python.org>
On 8 July 2014 15:59, <python@bdurham.com> wrote:
>
> 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(). The 1st naming convention sounds more natural, the 2nd naming convention allows one to group related functions together by the object being acted on. PEP-8 doesn't appear to offer guidance in this area. Thoughts? Malcolm

If you want to group related functions together, I would suggest
putting them in a module, e.g. 'fileutils'.  I'd still go for hashfile
for the function name though.

-- 
Arnaud

[toc] | [standalone]


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


csiph-web