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


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

Style question -- plural of class name?

Started byroy@panix.com (Roy Smith)
First post2013-05-08 16:20 -0400
Last post2013-05-09 18:44 +0100
Articles 16 — 14 participants

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


Contents

  Style question -- plural of class name? roy@panix.com (Roy Smith) - 2013-05-08 16:20 -0400
    Re: Style question -- plural of class name? Skip Montanaro <skip@pobox.com> - 2013-05-08 15:33 -0500
      Re: Style question -- plural of class name? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-09 00:13 +0000
    Re: Style question -- plural of class name? John Downs <john.a.downs@gmail.com> - 2013-05-08 16:37 -0400
    Re: Style question -- plural of class name? Ian Kelly <ian.g.kelly@gmail.com> - 2013-05-08 14:45 -0600
    Re: Style question -- plural of class name? Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-08 22:40 +0000
      Re: Style question -- plural of class name? Neil Cerutti <neilc@norwich.edu> - 2013-05-09 15:14 +0000
        Re: Style question -- plural of class name? Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2013-05-09 19:43 +0300
          Re: Style question -- plural of class name? Neil Cerutti <neilc@norwich.edu> - 2013-05-09 17:28 +0000
    Re: Style question -- plural of class name? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-05-08 19:45 -0400
    Re: Style question -- plural of class name? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-09 00:02 +0000
      Re: Style question -- plural of class name? Cameron Simpson <cs@zip.com.au> - 2013-05-09 10:42 +1000
    Re: Style question -- plural of class name? Chris Angelico <rosuav@gmail.com> - 2013-05-09 10:12 +1000
    Re: Style question -- plural of class name? "Colin J. Williams" <cjw@ncf.ca> - 2013-05-08 20:38 -0400
      Re: Style question -- plural of class name? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2013-05-09 12:21 +0200
    Re: Style question -- plural of class name? Robert Kern <robert.kern@gmail.com> - 2013-05-09 18:44 +0100

#44964 — Style question -- plural of class name?

Fromroy@panix.com (Roy Smith)
Date2013-05-08 16:20 -0400
SubjectStyle question -- plural of class name?
Message-ID<kmec30$d12$1@panix2.panix.com>
FooEntry is a class.  How would you describe a list of these in a
docstring?

"A list of FooEntries"

"A list of FooEntrys"

"A list of FooEntry's"

"A list of FooEntry instances"

The first one certainly sounds the best, but it seems wierd to change
the spelling of the class name to make it plural.

[toc] | [next] | [standalone]


#44965

FromSkip Montanaro <skip@pobox.com>
Date2013-05-08 15:33 -0500
Message-ID<mailman.1459.1368045196.3114.python-list@python.org>
In reply to#44964
This one:

> "A list of FooEntry instances"

Besides the obvious spelling issues in the others, it's not
immediately clear if the list contains just FooEntry instances,
FooEntry classes (perhaps subclasses) or a mix of the two.  #4 makes
it clear.

Skip

[toc] | [prev] | [next] | [standalone]


#44981

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-05-09 00:13 +0000
Message-ID<518aea14$0$29997$c3e8da3$5496439d@news.astraweb.com>
In reply to#44965
On Wed, 08 May 2013 15:33:07 -0500, Skip Montanaro wrote:

> This one:
> 
>> "A list of FooEntry instances"
> 
> Besides the obvious spelling issues in the others, it's not immediately
> clear if the list contains just FooEntry instances, FooEntry classes
> (perhaps subclasses) or a mix of the two.  #4 makes it clear.


I don't think this is a real issue. There isn't normally any ambiguity 
between instances and subclasses. When you read "a list of ints", do you 
assume that the list looks like [int, MyInt, AnotherInt, FooInt] or do 
you expect it to look like [2, 7, 6, 1]?

The normal interpretation of "one or more Foo" is that we're talking 
about Foo *instances*, not subclasses of Foo. If that is not that case, 
then the onus is on the author of the documentation to make it clear that 
they are talking about subclasses.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#44966

FromJohn Downs <john.a.downs@gmail.com>
Date2013-05-08 16:37 -0400
Message-ID<mailman.1460.1368045454.3114.python-list@python.org>
In reply to#44964

[Multipart message — attachments visible in raw view] — view raw

On Wed, May 8, 2013 at 4:20 PM, Roy Smith <roy@panix.com> wrote:

> FooEntry is a class.  How would you describe a list of these in a
> docstring?
>
> "A list of FooEntries"
>
> "A list of FooEntrys"
>
> "A list of FooEntry's"
>
> "A list of FooEntry instances"
>
> The first one certainly sounds the best, but it seems wierd to change
> the spelling of the class name to make it plural.
> --
> http://mail.python.org/mailman/listinfo/python-list
>

How about: "A list with elements of type FooEntry"?  I also like the last
one: "A list of FooEntry instances".

[toc] | [prev] | [next] | [standalone]


#44967

FromIan Kelly <ian.g.kelly@gmail.com>
Date2013-05-08 14:45 -0600
Message-ID<mailman.1461.1368045959.3114.python-list@python.org>
In reply to#44964
On Wed, May 8, 2013 at 2:37 PM, John Downs <john.a.downs@gmail.com> wrote:
> On Wed, May 8, 2013 at 4:20 PM, Roy Smith <roy@panix.com> wrote:
>>
>> FooEntry is a class.  How would you describe a list of these in a
>> docstring?
>>
>> "A list of FooEntries"
>>
>> "A list of FooEntrys"
>>
>> "A list of FooEntry's"
>>
>> "A list of FooEntry instances"
>>
>> The first one certainly sounds the best, but it seems wierd to change
>> the spelling of the class name to make it plural.
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>
>
> How about: "A list with elements of type FooEntry"?  I also like the last
> one: "A list of FooEntry instances".

list<FooEntry>

*ducks*

[toc] | [prev] | [next] | [standalone]


#44971

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-05-08 22:40 +0000
Message-ID<kmek9m$s0v$1@dont-email.me>
In reply to#44964
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?
> 
> "A list of FooEntries"
> 
> "A list of FooEntrys"
> 
> "A list of FooEntry's"
> 
> "A list of FooEntry instances"
> 
> The first one certainly sounds the best, but it seems wierd to change
> the spelling of the class name to make it plural.

I wouldn't use an apostrophe for pluralisation.

The Normal pluralisation of FooEntry would be FooEntries. Who are you 
expecting to read the docstring? English majors, grammar nazis, wikipedia 
editors, programmers, or all 4?

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#45038

FromNeil Cerutti <neilc@norwich.edu>
Date2013-05-09 15:14 +0000
Message-ID<av1sq9Fqug0U2@mid.individual.net>
In reply to#44971
On 2013-05-08, Denis McMahon <denismfmcmahon@gmail.com> wrote:
> 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?
>> 
>> "A list of FooEntries"
>> 
>> "A list of FooEntrys"
>> 
>> "A list of FooEntry's"
>> 
>> "A list of FooEntry instances"
>> 
>> The first one certainly sounds the best, but it seems wierd to change
>> the spelling of the class name to make it plural.
>
> I wouldn't use an apostrophe for pluralisation.

If there's no chance for confusion between a class named FooEntry
and another named FooEntries, then the first attempt seems best.
Pluralize a class name by following the usual rules, e.g.,
"strings" and "ints".

-- 
Neil Cerutti

[toc] | [prev] | [next] | [standalone]


#45045

FromJussi Piitulainen <jpiitula@ling.helsinki.fi>
Date2013-05-09 19:43 +0300
Message-ID<qotppx0w1ck.fsf@ruuvi.it.helsinki.fi>
In reply to#45038
Neil Cerutti writes:

> If there's no chance for confusion between a class named FooEntry
> and another named FooEntries, then the first attempt seems best.
> Pluralize a class name by following the usual rules, e.g.,
> "strings" and "ints".

Like "strings" would be "foo entries". Which might work well.

(I mean, isn't the class named "str"?)

[toc] | [prev] | [next] | [standalone]


#45047

FromNeil Cerutti <neilc@norwich.edu>
Date2013-05-09 17:28 +0000
Message-ID<av24m9FgnmU1@mid.individual.net>
In reply to#45045
On 2013-05-09, Jussi Piitulainen <jpiitula@ling.helsinki.fi> wrote:
> Neil Cerutti writes:
>> If there's no chance for confusion between a class named
>> FooEntry and another named FooEntries, then the first attempt
>> seems best. Pluralize a class name by following the usual
>> rules, e.g., "strings" and "ints".
>
> Like "strings" would be "foo entries". Which might work well.
>
> (I mean, isn't the class named "str"?)

Yeah, that's not such a good Python example. I used it to replace
"chars" and felt good at the time. ;)

-- 
Neil Cerutti

[toc] | [prev] | [next] | [standalone]


#44975

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2013-05-08 19:45 -0400
Message-ID<mailman.1466.1368056720.3114.python-list@python.org>
In reply to#44964
On 8 May 2013 16:20:48 -0400, roy@panix.com (Roy Smith) declaimed the
following in gmane.comp.python.general:

> FooEntry is a class.  How would you describe a list of these in a
> docstring?
> 
> "A list of FooEntries"
> 
> "A list of FooEntrys"
> 
> "A list of FooEntry's"
> 
> "A list of FooEntry instances"
> 
> The first one certainly sounds the best, but it seems wierd to change
> the spelling of the class name to make it plural.

	A Folly of FooEntry

<G>

(though if one wants to consider "a school of fish", let the class be
its own plural...)
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#44977

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-05-09 00:02 +0000
Message-ID<518ae78a$0$29997$c3e8da3$5496439d@news.astraweb.com>
In reply to#44964
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

[toc] | [prev] | [next] | [standalone]


#44986

FromCameron Simpson <cs@zip.com.au>
Date2013-05-09 10:42 +1000
Message-ID<mailman.1472.1368060520.3114.python-list@python.org>
In reply to#44977
On 09May2013 00:02, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote:
| On Wed, 08 May 2013 16:20:48 -0400, Roy Smith wrote:
| > "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.

Frankly, not even then for me. I spell that "one A, two As".

| > "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"?

How about "a FooEntry list"?
-- 
Cameron Simpson <cs@zip.com.au>

Yes Officer, yes Officer, I will Officer. Thank you.

[toc] | [prev] | [next] | [standalone]


#44980

FromChris Angelico <rosuav@gmail.com>
Date2013-05-09 10:12 +1000
Message-ID<mailman.1469.1368058368.3114.python-list@python.org>
In reply to#44964
On Thu, May 9, 2013 at 6:20 AM, Roy Smith <roy@panix.com> wrote:
> "A list of FooEntry's"

Only if you put another apostrophe in:

"A list of 'FooEntry's"

But the delimited style is almost never of use. I'd go for this only
if there were some sort of automated markup being applied - if the
word FooEntry were turned into a hyperlink or something.

ChrisA

[toc] | [prev] | [next] | [standalone]


#44985

From"Colin J. Williams" <cjw@ncf.ca>
Date2013-05-08 20:38 -0400
Message-ID<518AF00C.8030207@ncf.ca>
In reply to#44964
On 08/05/2013 4:20 PM, Roy Smith wrote:
> FooEntry is a class.  How would you describe a list of these in a
> docstring?
>
> "A list of FooEntries"  0
>
> "A list of FooEntrys"   -1
>
> "A list of FooEntry's"  +1
>
> "A list of FooEntry instances"  No FooEntry is specified as a class.
>
> The first one certainly sounds the best, but it seems wierd to change
> the spelling of the class name to make it plural.
>

Colin W.

[toc] | [prev] | [next] | [standalone]


#45022

FromThomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de>
Date2013-05-09 12:21 +0200
Message-ID<kmftan$20s$1@r01.glglgl.de>
In reply to#44985
Am 09.05.2013 02:38 schrieb Colin J. Williams:
> On 08/05/2013 4:20 PM, Roy Smith wrote:
>>
>> "A list of FooEntry's"  +1

Go back to school. Both of you...

That is NOT the way to build a plural form...


Thomas

[toc] | [prev] | [next] | [standalone]


#45049

FromRobert Kern <robert.kern@gmail.com>
Date2013-05-09 18:44 +0100
Message-ID<mailman.1499.1368121471.3114.python-list@python.org>
In reply to#44964
On 2013-05-08 21:20, Roy Smith wrote:
> FooEntry is a class.  How would you describe a list of these in a
> docstring?
>
> "A list of FooEntries"
>
> "A list of FooEntrys"
>
> "A list of FooEntry's"
>
> "A list of FooEntry instances"
>
> The first one certainly sounds the best, but it seems wierd to change
> the spelling of the class name to make it plural.

I'm using services like Github more and more to talk about code, so I have taken 
to adopting its inline markup for `code` when referring to identifiers. Thus, I 
will often write

   A list of `FooEntry`s

But I don't mind

   A list of FooEntries

Hopefully there isn't also a `FooEntries` class.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

[toc] | [prev] | [standalone]


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


csiph-web