Re: Style question -- plural of class name?

2013-05-09 Thread Thomas Rachel

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
--
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-09 Thread Neil Cerutti
On 2013-05-08, Denis McMahon denismfmcma...@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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-09 Thread Jussi Piitulainen
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?)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-09 Thread Neil Cerutti
On 2013-05-09, Jussi Piitulainen jpiit...@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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-09 Thread Robert Kern

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

--
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-08 Thread Skip Montanaro
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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-08 Thread John Downs
On Wed, May 8, 2013 at 4:20 PM, Roy Smith r...@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.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-08 Thread Ian Kelly
On Wed, May 8, 2013 at 2:37 PM, John Downs john.a.do...@gmail.com wrote:
 On Wed, May 8, 2013 at 4:20 PM, Roy Smith r...@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.

listFooEntry

*ducks*
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-08 Thread Denis McMahon
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, denismfmcma...@gmail.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-08 Thread Steven D'Aprano
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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-08 Thread Chris Angelico
On Thu, May 9, 2013 at 6:20 AM, Roy Smith r...@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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-08 Thread Steven D'Aprano
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
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-08 Thread Colin J. Williams

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.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Style question -- plural of class name?

2013-05-08 Thread Cameron Simpson
On 09May2013 00:02, Steven D'Aprano steve+comp.lang.pyt...@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 c...@zip.com.au

Yes Officer, yes Officer, I will Officer. Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list