[Python-ideas] PEP 8 update on line length

Chris Angelico rosuav at gmail.com
Tue Feb 19 20:09:12 EST 2019


On Wed, Feb 20, 2019 at 11:19 AM Steven D'Aprano <steve at pearwood.info> wrote:
>
> On Wed, Feb 20, 2019 at 01:41:27AM +1100, Chris Angelico wrote:
>
> > page_count will usually be unambiguous. You might need total_pages to
> > mean "not the current section", thus leaving the shorter one available
> > for the narrower use. Obviously questions like this can't be answered
> > without context, but at an absolute minimum, "number_of" can almost
> > *always* be omitted.
>
> I disagree with that last bit.
>
> Of course we can replace "number_of" with its synonym "count", but we
> can't typically just omit it. Does "pages" mean the number of pages or
> the pages themselves?
>

Fair point. However, in any context where "pages" could be a list of
pages, you are unlikely to need a separate "pagecount", as it's just
the length of the list. Maybe it's the number of pages you're _going_
to need, or something. But it's nearly impossible to judge without
context.

Maybe "almost always" was too strong, but in real-world contexts, I
don't often need to specify that something is the "number of"
something.

ChrisA


More information about the Python-ideas mailing list