On Mon, 2011-06-20 at 05:24 -0400, Zdenek Pavlas wrote:
> Hi,
> 
> >> -def setFileLog(uid, logfile):
> >> +def setFileLog(uid, logfile, cleanup=[]):
> 
> > This is also a python gotcha:
> > http://stackoverflow.com/questions/2170684/python-init-argument-problem
> 
> Thanks for pointing this out!  We very likely have only one call site
> and that sets the argument explicitly.  Should the default be used it
> would result in (intended) no-op and a small memory leak.  Preventing
> the leak is probably not worth adding an 'if' into the code path
> although I'm not quite sure.

 Adding a single if check is no big deal ... annoying complaints in BZ
from something that uses the API will be much more annoying IMO :)

>   I'd like to drop the default anyway..  Do we have a policy on
> changing the method's signatures?

 In general adding keyword args. to the end is fine, always for plain
functions. Do "cleanup=None" and then a simple 
"if cleanup is None: cleanup = []" at the top (which is what most of the
other functions like this do).

_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to