[Python-ideas] Boolean parameters guidelines

Steven D'Aprano steve at pearwood.info
Tue May 10 09:48:59 EDT 2016


On Tue, May 10, 2016 at 09:34:56AM -0400, Barry Warsaw wrote:
> On May 10, 2016, at 11:29 PM, Nick Coghlan wrote:
> 
> >This is actually a good point - at the moment, PEP 8 is a mix of
> >coding style guidelines (i.e. how we use existing APIs) and API design
> >guidelines (especially the parts on naming conventions and defining
> >what is and isn't a public API).
> >
> >For code reviews, we want the former, but for PEP discussions we want
> >the latter. Perhaps it would make sense to give API design guidelines
> >a dedicated home in the developer guide, rather than overloading PEP 8
> >with them?
> 
> PEP 8 is a *style guide*.

Surely if we are discussing what PEP 8 *is*, then it is what Nick 
describes: a mix of coding style guidelines and API design guidelines.

If people wish to separate the two into separate documents, that's one 
thing, but regardless of what PEP 8 claims to be, it does contain both 
style and API guides. Right now, that's what it is, whether that's what 
it was intended to be or not.

(Personally, I think that coding style and API design overlap and that 
it is pointless to try to separate them. Coding style isn't only how to 
name your variables, but also includes whether you use map versus list 
comprehensions, whether you raise exceptions or return error codes, 
whether you write in a Java-influenced Design Pattern style or a 
functional style, when to use bool arguments and when not to.)



-- 
Steve


More information about the Python-ideas mailing list