<div dir="ltr">+1 on <span style="font-family:"helvetica neue",helvetica,arial,sans-serif;font-weight:bold;white-space:nowrap">Steven D'Aprano's</span><span style="font-family:"helvetica neue",helvetica,arial,sans-serif;white-space:nowrap"> suggestion (And thus <b>Nick's</b> too).</span><div><span style="font-family:"helvetica neue",helvetica,arial,sans-serif;white-space:nowrap"><br></span></div><div><span style="font-family:"helvetica neue",helvetica,arial,sans-serif;white-space:nowrap">I have seen <b>way</b> too many complicated functions with lots of booleans that create an ugly 20 lines function call.</span><br></div><div><span style="font-family:"helvetica neue",helvetica,arial,sans-serif;white-space:nowrap">I agree that splitting into 2 if possible is a good idea, and in the cases it's not, requesting keyword only arguments</span></div><div><span style="font-family:"helvetica neue",helvetica,arial,sans-serif;white-space:nowrap">is a great solution.</span></div><div><span style="font-family:"helvetica neue",helvetica,arial,sans-serif;white-space:nowrap"><br></span></div><div><span style="font-family:"helvetica neue",helvetica,arial,sans-serif;white-space:nowrap">I do think though that in case of many possible options, using IntEnums and OR operators is the preferable method,</span></div><div><span style="font-family:"helvetica neue",helvetica,arial,sans-serif;white-space:nowrap">unlike open() that uses a string, but that's again just a private opinion.</span></div><div><span style="font-family:"helvetica neue",helvetica,arial,sans-serif;white-space:nowrap"><br></span></div><div><span style="font-family:"helvetica neue",helvetica,arial,sans-serif;white-space:nowrap">Huge +1.</span></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, May 9, 2016 at 8:58 PM Chris Barker <<a href="mailto:chris.barker@noaa.gov">chris.barker@noaa.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, May 8, 2016 at 6:08 AM, Eric V. Smith <span dir="ltr"><<a href="mailto:eric@trueblade.com" target="_blank">eric@trueblade.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
</span>Wouldn't that be "for every (or almost every) call-site"? </blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>"most call sites" would be fine. The common use case matters, it's not that hard to conditionally call a different function, as long as that's the uncommon use-case.</div><div><br></div><div>The other key here is that even if a boolean flag does essentially select between two different function, there are times where there is more than one such boolean flag for a single function, so you end up with 2**n "different" functions -- in this case, probably better to just use the flags and have one calling point.</div><div><br></div><div>-CHB</div><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><br clear="all"><div><br></div>-- <br><div><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R (206) 526-6959 voice<br>7600 Sand Point Way NE (206) 526-6329 fax<br>Seattle, WA 98115 (206) 526-6317 main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a></blockquote></div>