Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74198
| References | <1404831558.6942.139345801.530E4959@webmail.messagingengine.com> |
|---|---|
| Date | 2014-07-08 19:31 +0100 |
| Subject | Re: Naming conventions for functions and methods |
| From | Arnaud Delobelle <arnodel@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.11650.1404844289.18130.python-list@python.org> (permalink) |
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
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Naming conventions for functions and methods Arnaud Delobelle <arnodel@gmail.com> - 2014-07-08 19:31 +0100
csiph-web