<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jun 21, 2013, at 8:05 AM, <a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hello,<br><br>I've noticed there are a couple public APIs in Twisted now that accept a "private" positional argument.  I use scare quotes because I don't see how it's actually possible to make a positional argument private.<br><br>Given a function defined like this:<br><br>  def foo(_bar=None):<br>      ...<br><br>There is no indication that a use like this is problematic:<br><br>  foo(3)<br><br>Perhaps the situation will be different with keyword-only arguments, but for positional arguments I think it's unproductive and perhaps even confusing to name arguments this way.<br><br>I suggest we fix the couple places where this has been done so far and we avoid introducing any new instances.<br><br>FWIW, I found two examples of this in Twisted using:<br><br>  $ grep -E '\W_reactor' twisted/ -r --include '*.py' | grep -E 'def\W'<br></div></blockquote></div><br><div>I second this suggestion.</div><div><br></div><div>Furthermore, in most cases where one is tempted to make a reactor *attribute* private, it's probably best to make it public.  There are lots of legitimate uses to parameterize the reactor and to discover which one a particular object is using.</div><div><br></div><div>The case where one is tempted to make an argument private like this seems to be somewhere that we feel that something should be parameterized "only for testing".  If we need to parameterize it for testing, our users probably need to parameterize it for *their* tests, too.</div><div><br></div><div>-glyph</div><div><br></div></body></html>