Hello,

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.

Given a function defined like this:

   def foo(_bar=None):
       ...

There is no indication that a use like this is problematic:

   foo(3)

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.

I suggest we fix the couple places where this has been done so far and we avoid introducing any new instances.

FWIW, I found two examples of this in Twisted using:

   $ grep -E '\W_reactor' twisted/ -r --include '*.py' | grep -E 'def\W'

Jean-Paul

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to