Style question -- plural of class name?
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Wed May 8 20:02:18 EDT 2013
On Wed, 08 May 2013 16:20:48 -0400, Roy Smith wrote:
> FooEntry is a class. How would you describe a list of these in a
> docstring?
Which language are you writing your docstrings in? Obey the normal rules
of spelling, grammar and punctuation for your language, which I assume is
English.
> "A list of FooEntries"
Perfectly acceptable.
> "A list of FooEntrys"
There is no standard variant or dialect of English (British English,
American English, etc.) that pluralises Entry as Entrys, so that would be
"absolutely not".
> "A list of FooEntry's"
"Here come's an S! Quick, jam on an apostrophe!"
This is called the grocer's apostrophe, and is universally held in
contempt no matter what variant of English you write in. Don't do this.
The only acceptable use of an apostrophe to make a plural is if the thing
being pluralised is a single letter. E.g. one a, two a's.
> "A list of FooEntry instances"
This is also acceptable, although a little wordy. Do you write "a list of
strings" or "a list of str instances"?
> The first one certainly sounds the best, but it seems wierd to change
> the spelling of the class name to make it plural.
No weirder (note spelling) than changing any other noun. Whether you
change "int" to "ints" or FooEntry" to "FooEntries", you're still
changing it. That's how you make it plural.
--
Steven
More information about the Python-list
mailing list