<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 10, 2016 at 6:15 AM, Joseph Martinot-Lagarde <span dir="ltr"><<a href="mailto:contrebasse@gmail.com" target="_blank">contrebasse@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Serhiy Storchaka <storchaka@...> writes:<br>
<br>
> 1. It is preferable to pass boolean arguments as keyword arguments (if<br>
> this is not the only argument).<br>
><br>
> 2. It is preferable to declare boolean parameters as keyword-only<br>
> parameters.<br>
><br>
<br>
</span>It is true for literal keywords arguments, but passing a named variable with<br>
a boolean value can be fine.<br>
<br>
# Bad<br>
my_func(True)<br>
<br>
# Good<br>
my_func(enable=True)<br>
<br>
# Good<br>
enable=True<br>
my_func(enable)<br>
<br>
# Meh<br>
enable=True<br>
my_func(enable=enable)<br>
<br>
# Bad<br>
w=True<br>
my_func(w)<br></blockquote></div><br></div><div class="gmail_extra">That list of examples seems to be aligned along the wrong axis.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>