Style question -- plural of class name?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed May 8 20:13:09 EDT 2013


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



More information about the Python-list mailing list