[Python-ideas] Boolean parameters guidelines

Sven R. Kunze srkunze at mail.de
Wed May 11 12:10:23 EDT 2016


On 07.05.2016 23:41, Serhiy Storchaka wrote:
> I propose to add following recommendations in PEP 8 or other documents:
>
> 1. It is preferable to pass boolean arguments as keyword arguments (if 
> this is not the only argument).
>
> 2. It is preferable to declare boolean parameters as keyword-only 
> parameters.

As this proposal concerns the readability of code, the situation is 
arguably worse for boolean parameters; so +1.

Additionally, it seems like this could be said for other primitive 
datatypes as well:


 >>> sleep(100)  # minutes?


Sven




More information about the Python-ideas mailing list